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

RE: Adding callbacks to the core

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
August 20, 2001 14:34
Subject:
RE: Adding callbacks to the core
Message ID:
5.1.0.14.0.20010820173212.02059e78@tuatha.sidhe.org
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.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About