[Twisted-Python] Gtk2Reactor: what are the reasons for avoiding GLib functions?

Jason Heeris jason.heeris at gmail.com
Tue Apr 5 09:19:12 EDT 2011


On 5 April 2011 20:06, Žiga Seilnacht <ziga.seilnacht at gmail.com> wrote:
> I think that the main reason for PortableGtkReactor being used on Windows
> is due to glib's IO channels limitations on Windows. You can only have 63
> channels in the event loop at the same time due to g_poll's use of
> MsgWaitForMultipleObject.

The trouble is, PortableGtkReactor is just out-and-out unusable for
certain applications. In my case, it turned a 3 minute comms session
into a 25 hour session — OR, I could have my app completely max out
the CPU while it's running. Neither is workable in any realistic
context. But I'm pretty sure I don't need > 63 I/O channels open at
once, unless I'm missing something about the inner workings of
Twisted.

(I mean no offense, I can see why it has to work the way it does...
but its weakness shows up in exactly the kind of protocol I need to
use.)

> In addition, IO channels are quite buggy on Windows when used for sockets,
> see the comment at the top of the glib/giowin32.c file in the glib source
> for a list of issues. E.g. I suspect that the second problem described in:
>
> https://bugzilla.gnome.org/show_bug.cgi?id=357674
>
> is responsible for Twisted's ticket #3371, because a similar problem
> can be seen with win32eventreactor (ticket #4950), which also uses
> WSAEventSelect for socket monitoring.

Hmm. I may be in over my head here. But I won't give up just yet,
since it *would* be nice to be able to use PyGTK for the things I need
to do.

Thanks for the info,
Jason



More information about the Twisted-Python mailing list