[Tutor] global interpreter lock

khalil zakaria Zemmoura zemmoura.khalil at gmail.com
Thu Sep 15 09:44:44 EDT 2016


Basically, what that said is the global interpreter lock is something that
allows only one thread at a time to be executed when you launch a python
program in opposition of executing multiple threads at the same time
(parallelism). when you launch a python program it create a process in
memory. because of the GIL you cannot do parallelism in an efficient way,
but if you are not using threads, you shouldn't care about.
The GIL was relevant when we had one processor in our machine and honestly
it facilitate the development of the core maintainers of the CPython. Now
we have multicore processor, it start to be restrictive for some people,
not all but some of them who need to compute data and want to use all the
power they have.

Instead of giving you some examples I'll give you a link of some great
presentations made by David Beazly

Understanding the GIL:
https://m.youtube.com/watch?v=Obt-vMVdM8s

Embracing the GIL:
https://m.youtube.com/watch?v=fwzPF2JLoeU

Concurrency from the ground:
https://m.youtube.com/watch?v=MCs5OvhV9S4

This guy will explain to you better than I I'll do.

Hope that helps.
Regards.

Le 15 sept. 2016 09:18, "anish singh" <anish198519851985 at gmail.com> a
écrit :

> Can someone explain global interpreter lock with
> some source code examples?
>
> I didn't understand explanation offered here:
> https://docs.python.org/3/glossary.html#term-global-interpreter-lock
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list