Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Welcome to the Monastery
 
PerlMonks  

Re: How can I run a piece of code asyncronously in Perl?

by pemungkah (Priest)
on Nov 02, 2012 at 22:29 UTC ( #1002058=note: print w/ replies, xml ) Need Help??


in reply to How can I run a piece of code asyncronously in Perl?

If you're running on a Unix-ish system (not Windows), you can use the fork-and-exit trick to essentially make your subtask a child of init instead of your script, running it almost exactly as if you'd run it in the background from the shell: Re: Reaping Zombies (dont wanna wait).

This will run the code as an independent process; no memory will be shared between the new process and the old one. If you need to do that, threads are better.


Comment on Re: How can I run a piece of code asyncronously in Perl?
Re^2: How can I run a piece of code asyncronously in Perl?
by Doctrin (Beadle) on Nov 03, 2012 at 18:53 UTC
    Wow. This is exactly what I was trying to say. TYVM!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2014-04-21 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls