Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Signal to a sleeping Perl program

by afoken (Chancellor)
on Jan 17, 2020 at 15:36 UTC ( #11111529=note: print w/replies, xml ) Need Help??


in reply to Signal to a sleeping Perl program

I have [a] [...] script that [...] sleeps [...] If I add an ALRM signal handler, the ALRM stops working

One problem is in the man page sleep(3), at least on Linux:

Bugs

sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and sleep() is a bad idea.

Using longjmp(3) from a signal handler or modifying the handling of SIGALRM while sleeping will cause undefined results.


program keeps running!!!! Any thoughts?

Multiple exclamation marks ...

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2023-12-10 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?