|
cooperative threads with generators: msg#00112gnome.gtk+.python
Hi all, I've seen quite a few posts about threading problems in this group and am surprised to see that nobody recommended cooperative threading using generators. See http://www.daa.com.au/pipermail/pygtk/2001-October/002056.html and http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html Advantages: * Guaranteed to work regardless of underlying thread support * Much simpler to code and debug, no need for locks, semaphores etc. * Allows extremely efficient scheduling. Thread creation/deletion overhead is minimal. Disadvantages: * Potentially long running or blocking operations (file.read etc) need to be handled with care. The flexible scheduling is especially useful. In my MDI app I have a fifo queue for each document and the scheduler runs the queue for the currently focused document before any others. Stephen. -- Stephen Kennedy <steve9000@xxxxxxxxxxxx> http://meld.sf.net visual diff and merge _______________________________________________ pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Changing the Stock Buttons: 00112, Jan Weil |
|---|---|
| Next by Date: | Re: [omniORB] Re: Conflicting omniORBpy and PyORBit: 00112, Jon Willeke |
| Previous by Thread: | multiple windows?i: 00112, William Hanlon |
| Next by Thread: | Re: cooperative threads with generators: 00112, Christian Reis |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |