Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Kill and free the memory Never ending threads from main

by BrowserUk (Pope)
on Aug 24, 2013 at 06:35 UTC ( #1050771=note: print w/replies, xml ) Need Help??


in reply to Kill and free the memory Never ending threads from main

But when I am exiting the threads are still running I want to free all the space occupied by this threads and then exit from the script

When your main thread exits; any other threads will be killed and cleaned up automatically.

If you wish to suppress this oh so useful informational message:

C:\Downloaded\testp>perl -Mthreads -E"async{ sleep; }; say 'hi & bye'; hi & bye Perl exited with active threads: 1 running and unjoined 0 finished and unjoined 0 running and detached

Just detach the threads:

C:\Downloaded\testp>perl -Mthreads -E"async{ sleep; }->detach; say 'hi + & bye';" hi & bye

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050771]
help
Chatterbox?
[Lady_Aleena]: Some are as easy as returning instead of printing, but only some.
[atcroft]: Lady_Aleena: So you are shoving the disparate data into a structure and returning the structure, so you can run it through a (probably simpler) routine that displays only?
[Lady_Aleena]: atcroft, that is the goal.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2017-05-29 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?