laziness, impatience, and hubris | |
PerlMonks |
Re^2: threads: spawn early to avoid the crush.by zentara (Archbishop) |
on Mar 02, 2006 at 16:24 UTC ( [id://533956]=note: print w/replies, xml ) | Need Help?? |
there is basically nothing that threading has to offer (well, headaches and longer development times, I see just the opposite. When you have a situation where you need to share data between separate processes, it is easier for me to use threads and threads::shared. I suppose if you are used to setting up safe shared memory segments for IPC, then it may be easier for you. But I still see in that situation, threads and shared data is easier to setup, and safer. I shudder when I see those shared memory segments which are not cleaned up.....I've seen some shared mem segment apps,which are supposed to clean up after themselves, leave shared memory segments intact, after a kill 9 or a control-c. I will take threads anyday. Additionally, shared mem segments work differently on win32 and unix/linux, so you need to code twice. Whereas threads work the same on win32 and unix/linux, as far as perl code is concerned. And there is the option of dealing with a gazillion pipes....yuck. But I agree with you that if you don't need to share data, forking is preferred over threads. I'm not really a human, but I play one on earth. flash japh
In Section
Meditations
|
|