[Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

"Martin v. Löwis" martin at v.loewis.de
Thu Feb 15 08:22:29 CET 2007


Greg Ewing schrieb:
> On unix at least, I don't think it should be necessary
> to change gtk, only pygtk. If it can find out the file
> descriptor of the connection to the X server, it can
> plug that into the reactor, and then call
> gtk_main_iteration_do() whenever something comes in
> on it.

That is insufficient. The gtk main loop has more input
sources than just the connection to X:
- timers can be registered, which are called when the
   time comes
- idle handlers can be registered which are called when
   there are no other events
- child handlers are invoked when a child process
   terminates
- additional file descriptors can be registered
   (probably used for sockets primarily)
- a generalzed 'event source' can be hooked into it,
   with C functions for prepare, check, dispatch, and
   finalize

See

http://www.gtk.org/api/2.6/glib/glib-The-Main-Event-Loop.html

Regards,
Martin



More information about the Python-Dev mailing list