Perl's threading model,not that bad afterall

I've been checking the latest developments in the new C++ standard, C++11, and noticed that it now has support for thread local storage.

It adopts a "hybrid" approach; sharing by default but also using TLS slots for storing globals with thread scope
This reminded me that the last .NET version has an option like that
"New in .NET 4.5: ThreadLocal.Values"
as well as the "It's Not Always Nice To Share" article which concludes that it is better to share nothing by default but share explicitly

Now, I know that Perl's threading model takes TLS one step further down and that it has been heavily criticized as being "not true threading"
but all this makes me think that it is not that bad after all, but rather simplifies things and mirrors Perl's philosophy of "just getting things done"

So what's after that ? The next .NET version or C++ standard fully embracing Perl's threading model in a "back to the future" fashion ? (active since version 5.8)
Would love to see that !


IMO problem of perl threads is not that they not sharing variables by default, but that they too slow to start and memory inefficient.

My problem with current perl threading model is not that by default variables are not shared. My problem is that even shared variables are local thread variables that are copied back and forth between the threads

Leave a comment

About nikosv

user-pic I blog about Perl.