There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I've been always told NOT to do what you're advising here,
if you're forking off many children, and put the same data into every one of those, you get No#Children*DataStructureSize memory consumption, if you initalise everything in master thread, then the children will have their own copy-on-write copy of the datastructure, and you get 1*DataStructureSize memory consumption.
Although it looks like your advice, when it comes to perl and not general computing, is right:
I'm still avoiding threads with perl, there's no good reason for lib authors to make their libs thread-safe, thus your perl apps will never be thread-safe, and, there is basically nothing that threading has to offer (well, headaches and longer development times, but if we wanted that, we would be programming java)
In reply to Re: threads: spawn early to avoid the crush.
by Eyck
|
|