Do you know where your variables are? | |
PerlMonks |
Re: Re: Re: Multi-Threading in Perlby LunaticLeo (Scribe) |
on Dec 26, 2001 at 22:04 UTC ( [id://134444]=note: print w/replies, xml ) | Need Help?? |
Threads are much more efficient...It is also harder to have 2+ forks() communicate (PIPE or socket or shared memory) vs direct access to all data structures
For the love of all that is holy why do you youngsters think this stuff. Free your mind (from Win32s land) and your code will follow. Efficiantcy: fork() + SysV shared memory is just as fast on Linux as threads. Further, you get the advantage of explicitly shared data, rather than the joys of tracking down obscure memory corruption bugs. Easy of Use: Unix process calls + SysV shared memory API are far more simple than the POSIX thread API and more useful to learn overall. Threads are faster for context switching than processes on old propietary unixen/winnt. That is because all those proprietary OSes were created to sell hardware. Why should they care about speeding up the common case? Unix is an amazing API. With proper implementation it is awsomely powerful, fast, and simple. Threads are a context switching optimization/abomination. However, perl threads could make POE really cool on multi-processor machines (re: thread per CPU to implement an explicit state machine).
In Section
Seekers of Perl Wisdom
|
|