develooper Front page | perl.perl5.porters | Postings from August 2001

RE: Adding callbacks to the core

Thread Previous | Thread Next
Dan Sugalski
August 20, 2001 14:34
RE: Adding callbacks to the core
Message ID:
At 04:09 PM 8/20/2001 -0500, David M. Lloyd wrote:
>I'm hesitant to mess with the current event stuff because it was really
>not designed to do anything but signals.  The basic logic runs like this:
>Do I have a signal? If yes:
>1. Reset signal pending flag.
>2. Scan PL_psig_pend to find any waiting signals... this includes scanning
>for signals that are not waiting. For each waiting signal, call
>(*PL_sighandlerp) with the signal.
>The (current) callback checker would run like this:
>Do I have a callback? If yes:
>1. Run all callbacks.

Right, but what you do is:

1) Is there something out there?
2) Is it a signal? Go do the signal stuff
3) Is it a callback? Do the callback stuff

Basically you add a layer on top of what's there now, so there's a combined 
"There's something out there" flag. Once you see there's something out 
there is when you go do all the different types of checks. You could even 
go so far as to, say, have bit 0 mean pending signal and bit 1 mean pending 
callback, though there are threading/async ramifications there.


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                      teddy bears get drunk

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About