Re: is Event the best event loop module?

[email protected] (Danny Faught)
Newsgroups perl.loop
Organization Tejas Software Consulting
Message-ID <[email protected]>
Joshua Pritikin wrote:
> Danny Faught wrote:

> >Also, I've tripped over some big signal concurrency issues looking at
> >writing an event loop using a blocking select call....
> 
> No, Event tries its best to wait inside poll/select.
> AFAIK, this is the proper way to inform the
> kernel that the process is idle.

Thanks for your help.  I had missed a whole directory of source code. 
So you're depending on the poll/select to wake up when a signal arrives?

It looks like your signal handler just sets a flag when it's invoked,
which is the same way I do it.  This means that you depend on the event
loop to wake up and check the flag.  But what happens if a signal comes
in right before the poll/select call?  The signal won't wake it up.  

I don't see any of the common hacks to avoid this, such as doing a
longjump out of the signal handler.  I see the pe_signal_asynccheck
function that talks about avoiding race conditions, but I don't
understand XS well enough to track how it's called.
--
Danny Faught
Tejas Software Consulting
http://www.tejasconsulting.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.