Re: External event loop for glib?



I have already looked at ways to use glibs main-loop in pike (when
using GTK).

It's not easy. Not even close to easy. Glibs main-loop might have
improved since I looked at it last time, though (it has been about
three weeks).

Pikes main loop is actually more 'threaded' than glibs, you can remove
fds (and handles, under NT) from it while it's waiting for events, and
while it's calling call-backs, without breaking anything. 

I failed to do that with glib. 

It also handles signals (which is not all that easy to do portably)
and reaping of children with call-backs (sigchild behaves drastically
different under Linux and Solaris, as an example. Under Linux you get
one signal / thread you have, while you only get one signal under
Solaris).

Most of the stuff above can be fixed using extra FDs, though
("internal" pipes).

It also handles has one call-back for oob read, one for oob write, one
for write, one for read and one for close events. That could be
simulated with a simple wrapper, though.

-- 
Per Hedbor                                              http://per.hedbor.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]