Python Forum
When will the GIL be removed?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When will the GIL be removed?
#1
Hello again,

this is a repost of the former "When will the GIL be removed?" thread, which has been lost by the hack attack.

There have been a number very useful links to videos of the Pycon Conference 2016 and especially from the Gilectomy project guy. I hope, they will be posted again, that future readers of this thread will have the same chances to follow the discussion. I got the following out of this videos:
1. The general interpreter lock (GIL) locks all (especially internal) variables for others threads.
2. This makes sequential python code run fast.
3. At the same time it inhibits threads to be (naturally) processed in parallel on the CPU, which means, threaded python code only runs on one CPU core, the other cores remain unused. (Recent CPUs have 4 to 8 cores).
4. The removal of the GIL (gilectomy) is a big deal, because the straight forward mulitiple interpreter locks approach following the CPython garbage collection framework of reference counting is slow. Thus, most probably garbage collection/ reference counting also must be redesigned in one breath.
(Please correct me, where I am wrong).

I am a numerical python programmer and I need parallel execution of my programs. So, how are you dealing with the current GIL situation, when you need parallel python execution, so that you won't need to reprogram all your programs in python 4.0, when the GIL is possibly removed and the dirty GIL workaround by the package multiprocessing is dispensible. AFAIK calling a process instead of calling a thread makes up a lot of additional processing ballast.

Consuli

P.S.:

In the former thread, there has been a very nice code example using the package concurrent.futures or similar, posted by one of the mods. Would be nice to be linked again.
Reply
#2
Guido Van Rossum will keep the GIL. Anyway, there are several ways to execute a code in parallel.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
If Van Rossum will keep the GIL for another 5 years, CPython will not be the standard python any more, but Gilectomy-Python, Cython, Jython or IronPython or another new Python fork. In 2 years we will have 16 core processors as standard, thus GIL-CPython will have only 1/16 of the performance of parellizing Python forks.

https://lwn.net/Articles/689548/
https://github.com/larryhastings/gilectomy
Reply
#4
(Nov-27-2016, 07:51 PM)consuli Wrote: If Van Rossum will keep the GIL for another 5 years, CPython will not be the standard python any more
Why do you believe this? I've literally never heard anyone in industry or outside claim that they would leave Python because of the GIL. I've been using Python for >10 years, and a professional software engineering for >3 years, and never once heard anyone suggest this.
Reply
#5
GIL does not allow Python interpreter memory access from another programs and processes.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
(Nov-27-2016, 10:00 PM)micseydel Wrote:
(Nov-27-2016, 07:51 PM)consuli Wrote: If Van Rossum will keep the GIL for another 5 years, CPython will not be the standard python any more
(...) claim that they would leave Python because of the GIL. (...)

I didn't say that. I said, they will migrate to another Python Fork. Effectively Python is not only CPython. There are other versions, I already mentioned.

(Nov-27-2016, 02:07 PM)wavic Wrote: (...) Anyway, there are several ways to execute a code in parallel.

Exactly. And I want to know, which of these parallel python opportunities will most probable survive the GIL removal in future Python version. I do not want to modify my parallel python code in future.
Reply
#7
(Nov-28-2016, 06:47 PM)consuli Wrote: I didn't say that. I said, they will migrate to another Python Fork. Effectively Python is not only CPython. There are other versions, I already mentioned.
My point stands. You've made a claim I've never heard anywhere else and you haven't provided justification for it.
Reply
#8
Why would the GIL be removed? Do you like locks?
Reply
#9
(Nov-28-2016, 08:01 PM)nilamo Wrote: Why would the GIL be removed?  Do you like locks?

Personally I wouldn't mind having the option to run at least some code without the GIL (maybe with a thread.start_nongil_thread function). Besides, you need locks today when working with threads regardless; you'd just need more. Disabling the GIL globally, however, would lead to subtle but potentially catastrophic breakage in existing code, which is about the worst possible breakage you can get.
Running Manjaro Linux 16.08/OpenRC/i3wm on a Dell Precision 5510.

John 3:17
Reply
#10
(Nov-27-2016, 11:27 AM)consuli Wrote: using the package concurrent.futures or similar, posted by one of the mods. Would be nice to be linked again.
Here is the link Web-scraping-part-2

PyPy Software Transactional Memory is the best try to remove GIL.
It's a hard problem so it will take a time,
and Mozilla gave PyPy $200,000 to Python 3.5 support.
So then Armin Rigo has to work on support for Python 3.5,and STM will stall in development .
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020