Re: External event loop for glib?



On 29 Mar 1999, Per Hedbor wrote:

> > I'm not sure if you are talking about actual OS threads or not.
> It's OS threads. Basically, pike is probably simply more debugged. :-)
> It has had a threaded main event loop for a few years now.
> 
> Pike uses two sets of pollfds, they are swapped just before poll. Then
> when poll is done, we check if the fd is still in the other fd-set
> before calling any callbacks.
> 
> > Simulating this stuff on systems without a native poll()
> > seems rather difficult. Does pike do it?
> 
> Yes, actually it does (more or less, the close/read callback
> differentiation stuff is handled by the default read callback,

I'm a bit curious about this: I can't think of any good implementation
that doesn't involve either adding special logic to read() within the
callback, or passing the expected amount of data to read to the callback
(so that it invokes read() for you).

> and the RDBAND and WRBAND is handled through the exception FDs when
> using select, outgoing exception data callback is somewhat advanced
> without poll, though, it's handled by checking the normal write set,
> this works with all unixes we have found so far). 
> 
> On NT we don't have OOB at all yet.
> 
> -- 
> Per Hedbor                                              http://per.hedbor.org/

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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