Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Re: Multi-Threading in Perlby edebill (Scribe) |
on Dec 26, 2001 at 07:17 UTC ( [id://134340]=note: print w/replies, xml ) | Need Help?? |
Why is there a need for some 'threading' mechanism in Perl whereas it already has the 'fork' call? It's hard to share data structures across a fork(). Yes, you can always get the job done using shared files, signals, pipes and such. But for some things it's just a lot more clean to pthread_mutex_lock(), change a variable, and pthread_mutex_unlock(). And select() loops are just obnoxious compared to having a separate thread or process to handle each incoming network connection (as long as you're not expecting super high performance with lots of clients) Perl's threading works nicely - but it doesn't port to every platform perl does. This has caused me to rewrite at least one app which was originally started in perl using C. Good thing I "planned to throw one away".
In Section
Seekers of Perl Wisdom
|
|