Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Is the signal handler supposed to work like this?

by tilly (Archbishop)
on Aug 30, 2008 at 02:39 UTC ( [id://707873]=note: print w/replies, xml ) Need Help??


in reply to Is the signal handler supposed to work like this?

Mixing signal handling and threads is unwise. The problem is that you have no control over which thread will receive the signal. If 2 threads disagree on how to handle the signal, you get inconsistent behaviour.

To get unsafe signal handling in Perl, you just need to set the environment variable PERL_SIGNALS to the value "unsafe" before you call Perl. Unsafe signal handling is important when you have long-running opcodes that might block the handling of a signal. A perfect example of such an opcode is calling out to a C library. Think a long-running database handler. If you are using safe signals, that query cannot be interrupted. Your problem doesn't "smell" like an unsafe signals issue, but now you know how to do it if you want to experiment.

  • Comment on Re: Is the signal handler supposed to work like this?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-24 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found