Just another Perl shrine | |
PerlMonks |
Re^12: Amicable divorceby salva (Canon) |
on Jul 24, 2020 at 15:48 UTC ( [id://11119766]=note: print w/replies, xml ) | Need Help?? |
No amount of syntax will give me SMP-multithreading in Perl Do you mean perl 5.005 threads? IIRC, the conclusion we got from there is that it is not doable without rewamping the runtime completely. Perl internal data structures were never designed for atomic access so locks need to be used to serialize their access. You could do as Python, have a global lock (bye bye SMP!) or require the programmer to lock by hand (that was the 5.005 approach), but that didn't work. Most modules failed to work in multithreading environments, usually because of the perl internals becoming corrupted... XS code was even worse. Perl 5.6 threads was a compromise where everything is cloned so that there is no interference between threads and whenever you want to share something, you have to say it explicitly and an intermediate (and quite inefficient) layer that does the locking and serializes access is set up by the runtime. So, in conclusion, do you want SMP in Perl 5? then write a new runtime! and forget about compatibility with any XS module!!! Would it be worth the trouble? IMO, well, maybe yes. There are so many things in Perl 5 that need fixing that could only be fixed by using a new runtime!!! But anyway, who is gonna do it? Update: oops, s/5\.6/5.005/g; s/5\.8/5.6/g;. I knew I had it wrong because I can still remember my excitment trying the threads support with LWP and getting SIGSEGVs all the time when perl 5.005 was released 22 years and two days ago! Just one of those things than randomly stick in your mind!
In Section
Meditations
|
|