On Wed, 2010-07-07 at 08:00 +0800, Jason Heeris wrote: > Antoine Martin wrote: > > > It means that most of your code is not using threads at all, only the > > bits that are *slow* > > Those are the only bits that use threads anyway. > > > I've lost track of your particular issue though, so maybe this is not > > suitable for your use-case? How much slow work do you do compared to the > > rest? (how many code paths, rather than raw amount) > > I have two kinds of long-blocking work: reading a large file and > processing it to get a single result, and communication over a serial > port (send command, await response, times about a hundred).
In the serial port case, I use glib.io_add_watch on the file descriptor. Check out my UAV ground station software which does a *lot* of serial comms, and works perfectly in windows and linux [1] I also have a little helper lib that makes working with gobject and python-libserial a little nicer [2] John [1] http://github.com/nzjrs/wasp [2] http://github.com/nzjrs/libserial > > — Jason > _______________________________________________ > pygtk mailing list [email protected] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
