Benefits and Drawbacks
Use of a Global Interpreter Lock in a language effectively limits the amount of parallelism reachable through concurrency of a single interpreter process with multiple threads. If the process is almost purely made up of interpreted code and does not make calls outside of the interpreter for long periods of time (which can release the lock on the GIL on that thread while it processes), there is likely to be very little increase in speed when running the process on a multiprocessor machine. Due to signaling with a CPU-bound thread, it can cause a significant slowdown, even on single processors.
Reasons for employing such a lock include:
- increased speed of single-threaded programs (no necessity to acquire or release locks on all data structures separately)
- easy integration of C libraries that usually are not thread-safe.
Read more about this topic: Global Interpreter Lock
Famous quotes containing the words benefits and/or drawbacks:
“One of your biggest jobs as a parent of multiples is no bigger than simply talking to your children individually and requiring that they respond to you individually as well. The benefits of this kind of communication can be enormous, in terms of the relationship you develop with each child, in terms of their language development, and eventually in terms of their sense of individuality, too.”
—Pamela Patrick Novotny (20th century)
“France has neither winter nor summer nor moralsapart from these drawbacks it is a fine country.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)