Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Print inside SIGNALS

by ikegami (Patriarch)
on Jul 16, 2018 at 14:21 UTC ( [id://1218587]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Print inside SIGNALS
in thread Print inside SIGNALS

If your C library's print function isn't re-entrant (many aren't), then there's always a chance that weird things happen when the signal goes off while your code is printing something.

That's not true for two reasons:

  • print doesn't use clib.
  • Since Perl 5.8.1, signals are deferred to be handled between Perl ops.

Replies are listed 'Best First'.
Re^5: Print inside SIGNALS
by haj (Vicar) on Jul 16, 2018 at 14:41 UTC
    Thanks for the correction! The rule "don't print in signal handling" stuck with me for too long, I should have checked this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found