Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: Perl seg fault while joining threadsby BrowserUk (Patriarch) |
on Jul 08, 2015 at 07:16 UTC ( [id://1133682]=note: print w/replies, xml ) | Need Help?? |
Is there any other way ? Yes. If you spawn a thread early, it will not copy anything created after it is spawned. If you then arrange for it to spawn the threads that you need to spawn later, they will inherit the cleanliness of their parent. Ie. Won't duplicate anything created after that first thread was spawned. The code below looks complicated, but it is really quite straight forward. If you wrap it into a module and call it before you call your initial module, the api can be pretty transparent. This just demonstrates the technique; you can do the wrapping to suit your code/style:
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.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
In Section
Seekers of Perl Wisdom
|
|