The Wikipedia article Global interpreter lock indicates that Raku has a global interpreter lock.
This contradicts Curtis Poe's response to Are any companies planning to use Perl 6?.
I suspect that the Wikipedia article is wrong - but maybe it is more complicated than that. Can somebody explain?
The Python Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter. This means that only one thread can be in a state of execution at any point in time.
Some language implementations that implement a global interpreter lock are CPython, the most widely-used implementation of Python, and Ruby MRI, the reference implementation of Ruby (where it is called Global VM Lock). JVM-based equivalents of these languages (Jython and JRuby) do not use global interpreter locks.
The GIL provides an important simplifying model of object access (including refcount manipulation) because it ensures that only one thread of execution can mutate Python objects at a time5. There are important performance benefits of the GIL for single-threaded operations as well.
The Global Interpreter Lock In other words, the lock ensures that only one thread is running at any given time. Therefore, it is impossible to take advantage of multiple processors with threads. Since the CPython's memory management is not thread-safe, the GIL prevents race conditions and ensures thread safety.
Global Interpreter Lock is easy to implement in python as it only needs to provide a single lock to a thread for processing in python. The GIL is simple to implement and was easily added to Python. It provides a performance increase to single-threaded programs as only one lock needs to be managed. Impact on multi-threaded Python programs :
A global interpreter lock (GIL) is a mutual-exclusion lock held by a programming language interpreter thread to avoid sharing code that is not thread-safe with other threads. In implementations with a GIL, there is always one GIL for each interpreter process .
Some popular interpreters that have GIL are CPython and Ruby MRI . A global interpreter lock (GIL) is a mutual-exclusion lock held by a programming language interpreter thread to avoid sharing code that is not thread-safe with other threads.
Technical background concepts. A global interpreter lock (GIL) is a mutual-exclusion lock held by a programming language interpreter thread to avoid sharing code that is not thread-safe with other threads. In implementations with a GIL, there is always one GIL for each interpreter process.
With some googling I've found some additional evidence that Perl 6 indeed has no GIL:
As the creator of Perl himself stated in an interview:
[...] For developers who are already sophisticated, they'll see that most of the problems endemic to the currently available dynamic languages are solved in Perl 6. We understand lexical and dynamic scoping. We detect most typos at compile time. We don't have a global interpreter lock.
Source: Perl creator Larry Wall: Rethought version 6 due this year
Some more evidence:
I don't know why, but the addition of Perl 6 to the Wikipedia article was done two weeks ago and maybe it needs to be reverted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With