[Python-Dev] Pythonic concurrency - cooperative MT
solipsis at pitrou.net
Fri Sep 30 18:33:29 CEST 2005
Le vendredi 30 septembre 2005 à 12:20 -0400, Jp Calderone a écrit :
> "Advocating" might be putting it too strongly :) "Experimenting with"
> describes the current state of things most accurately.
> The problem it aims to solve is integration with cooperative threading
> systems which don't work very well. An example of such a loop is the
> wx event loop.
> Whenever a modal dialog is displayed or a menu is activated, wx's loop
> stops cooerating.
This specific problem hides the more general problem, which is that GUI
and network activities have different typical latencies. As I explained
on the twisted ML, a GUI needs very good response times to feel friendly
(typically below 20 or even 10 ms.), whereas some network protocols have
non-trivial calculations which can go above 100 ms. Moreover, you don't
want a sudden flood of network events to block events in the GUI.
This is why even without considering wx's specificities, it is still
useful to keep GUI and network activities in separate threads.
More information about the Python-Dev