Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Signal to a sleeping Perl program

by afoken (Chancellor)
on Jan 17, 2020 at 15:36 UTC ( [id://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 imbibing at the Monastery: (6)
As of 2025-07-13 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.