Hacker News new | past | comments | ask | show | jobs | submit login

PyPy is actively working on an STM-based alternative. Does MoarVM avoid a GIL? If so, what approach are they taking?



Since Perl 5 doesn't have a GIL, I doubt any of the Perl 6s will. Threaded Perl has been a thing for 15 years or so. It's not something to "solve", either your interpreter is reentrant, or it isn't.

But spawning threads in your Perl code comes with the same set of problems as anywhere else, it's easy to create races or deadlocks, and Perl happily lets you do these things if you ask it to.


I think Perl 5 threading model is pretty broken. The official documentation explicitly discourages the use of threads [1]. Perl's threading model consists in running a separate interpreter on each thread without any data sharing, which practically the same as using multiple process except without the advantages.

[1] http://perldoc.perl.org/threads.html


It's not quite as bad as that, but it's close. There are some use cases where it's beneficial. The one I use it for is where I'm pre-creating workers and using the shared memory mechanisms and signalling of threads (which work quite well in Perl where it auto releases the lock based on scope).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: