Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: fork & END

by polettix (Vicar)
on Sep 07, 2005 at 09:56 UTC ( [id://489812]=note: print w/replies, xml ) Need Help??


in reply to fork & END

itub's solution is probably what you're looking for not to be brutal, but I'd object that you're probably looking the problem from the wrong point of view.

Doing a little shift to a similar field for the moment, it's clear that not all libraries are good to be used in a multithreaded world. This is because many times the library assumes to be the only owner of some resources, and the multithreaded environment does not guarantee this any more. The bottom line is that you have to adapt the library to work in the new environment, avoiding dirty tricks in the environment itself.

This case seems pretty similar. What if the module you're using is already fork-robust, but still needs to execute its END block to work properly in the quitting father? Skipping the END block would simply break it, and this doesn't seem too fair. Again, I think that the bottom line is that you have to make sure that the module is fork-robust, and not try to put dangerous work-arounds outside of them. The upgrading suggestion from xdg points in this direction IMHO (... 0.15 improved forking support...).

Just my 2c as usual,

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2025-07-13 20:19 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.