Back to an old thread.... Jason Tackaberry wrote: > On Tue, 2007-02-27 at 17:34 +0100, Dirk Meyer wrote: >> To avoid blocking we use a thread. But sqlite is not thread save >> and we need to run add_program in the main loop. So we have several >> choices: >> >> 1. Parse the while file and add later. This requires about 200 MB for >> your TV.xml file. >> >> 2. Jump to mainloop for each program we parse. >> >> IMHO 2. is more or less a good idea. The main loop 'polls' a variable >> the thread is writing. > > I agree, 2 is better for both memory usage and net performance (it's > better to continue to parse the XML file in a thread while waiting on > I/O for the sqlite db), and it's not hard to implement.
Done. Both add_program and add_channel are now thread safe. The interface is the same, so all parser should still work. I reworked the epgdata.com parser to use SAX in the thread and it looks good. The basic logic is in server.py so changing other parser should be simple, just do everything from the thread and call add_program_wait() at the end to wait until all programs are written. Dischi -- Hit any user to continue.
pgpD4WcHcLUez.pgp
Description: PGP signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
