3 ms·
PyPy is crippled by the GIL, why would you base your next hot new language that aims to be mainstream on that?
by Scarbutt 12y ago
PyPy is crippled by the GIL, why would you base your next hot new language that aims to be mainstream on that?
- sanxiyn 12y agoYou mean, like V8 being crippled by the GIL?
- deleted 12y ago[deleted]
- smegel 12y agoWhy would you need a GIL if you don't have threads in the first place?
- lmm 12y agoPyPy is actively working on an STM-based alternative. Does MoarVM avoid a GIL? If so, what approach are they taking?
- xorcist 12y agoSince 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.
- ceronman 12y agoI 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 http://perldoc.perl.org/threads.html
- kbenson 12y agoIt'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).
- masklinn 12y agoThe GIL is in PyPy, not in RPython, nothing precludes writing a GIL-less RPython-based VM. However RPython is not thread-safe and the GC it provides is not thread-aware, so you'd have to provide your own thread-aware GC (or a big GC lock)
- fijal 12y agothe stm-gc can be run without the STM in a way that's thread safe and does not have the STM overhead. It's almost as good as the PyPy GC (it's missing a few optimizations and it's not incremental, but can be made to work).