472,971 Members | 2,286 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,971 software developers and data experts.

Possible suggestion for removing the GIL

Hi,

Recently there was some talk on removing the GIL and even the BDFL has
written a blog post on it.
I was trying to come up with a scalable and backwards compatible
approach for how to do it.

I've put my thoughts up in a blog post - and I'd really like to hear
what the community thinks of it.
Mainly it revolves around dedicating one core for executing
synchronized code and doing context switches instead of acquiring/
releasing locks.

http://www.brainwavelive.com/blog/in...eter-Lock.html

Thanks,
Prateek Sureka

Sep 13 '07 #1
4 961
Prateek wrote:
Hi,

Recently there was some talk on removing the GIL and even the BDFL has
written a blog post on it.
I was trying to come up with a scalable and backwards compatible
approach for how to do it.

I've put my thoughts up in a blog post - and I'd really like to hear
what the community thinks of it.
Mainly it revolves around dedicating one core for executing
synchronized code and doing context switches instead of acquiring/
releasing locks.
Where is the gain? Having just one core doesn't give you true parallelism -
which is the main reason behind the cries for a GIL-less Python.

Diez
Sep 13 '07 #2
On Sep 13, 1:36 pm, "Diez B. Roggisch" <de...@nospam.web.dewrote:
Prateek wrote:
Hi,
Recently there was some talk on removing the GIL and even the BDFL has
written a blog post on it.
I was trying to come up with a scalable and backwards compatible
approach for how to do it.
I've put my thoughts up in a blog post - and I'd really like to hear
what the community thinks of it.
Mainly it revolves around dedicating one core for executing
synchronized code and doing context switches instead of acquiring/
releasing locks.

Where is the gain? Having just one core doesn't give you true parallelism -
which is the main reason behind the cries for a GIL-less Python.

Diez
Diez,

I was talking of dedicating one core for synchronized code. In the
case of a threaded app on two cores, one core would be dedicated to
synchronized code and the other would run non-sync code (effectively
behaving like a single threaded machine). However, on machines with n
cores where n 2 cores, we would have n-1 cores available to run code
in parallel.

Prateek

Sep 13 '07 #3
On 9/13/07, Prateek <su*****@gmail.comwrote:
On Sep 13, 1:36 pm, "Diez B. Roggisch" <de...@nospam.web.dewrote:
Prateek wrote:
Hi,
Recently there was some talk on removing the GIL and even the BDFL has
written a blog post on it.
I was trying to come up with a scalable and backwards compatible
approach for how to do it.
I've put my thoughts up in a blog post - and I'd really like to hear
what the community thinks of it.
Mainly it revolves around dedicating one core for executing
synchronized code and doing context switches instead of acquiring/
releasing locks.
Where is the gain? Having just one core doesn't give you true parallelism -
which is the main reason behind the cries for a GIL-less Python.

Diez

Diez,

I was talking of dedicating one core for synchronized code. In the
case of a threaded app on two cores, one core would be dedicated to
synchronized code and the other would run non-sync code (effectively
behaving like a single threaded machine). However, on machines with n
cores where n 2 cores, we would have n-1 cores available to run code
in parallel.
What you're describing would have the same characteristics as the
current code - code that is able to execute without the GIL held
already will run in parallel on a multi-core machine.
Sep 13 '07 #4
Prateek wrote:
[...]
Mainly it revolves around dedicating one core for executing
synchronized code and doing context switches instead of acquiring/
releasing locks.

http://www.brainwavelive.com/blog/in...eter-Lock.html
Context switches are generally more expensive than acquiring
and release locks. Most systems' run-queues are protected by
locks. The context switches at issue all involve the
dedicated core, so I do not see any parallelism advantage.
--
--Bryan
Sep 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jeff Lanfield | last post by:
First of all, I apologize if coalescing is not the right term to describe my problem. I have a tree where each node has the same set of attributes (is the same entity) but child nodes should...
3
by: Gunnar | last post by:
Hello. Problem: How can I select K random values from the elements 0,1,2,3,4...,N-1 ? I don't know if there's an easy way of doing this, but here are suggestions for doing it. One way is...
40
by: Ron Adam | last post by:
After considering several alternatives and trying out a few ideas with a modified list object Bengt Richter posted, (Thank You), I think I've found a way to make slice operation (especially far end...
15
by: Jon Skeet | last post by:
I've been briefly musing on what is probably a pretty silly idea, but one which would no doubt benefit from being discussed and thoroughly shot down in flames rather than being allowed to fester in...
4
by: CJ Taylor | last post by:
Alright, So this morning (as we are a week from launch on our product) I come across an error as I add a simple thing to our system. A display column in our dataset for databinding for display...
1
by: Wade | last post by:
Is it possible to connect to a SQL 2005 Express db using Visual Basic 2005 Express? I cannot get past the connection.open statement without the error "...Version=2.0.0.0;...
1
by: Joe Peterson | last post by:
I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is defined and a cyclic (circular) reference is...
2
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I want to give a user the possibility of "restarting" an interactive session, by removing all the objects defined by her since the beginning. The way I make this possible is by having a "function"...
7
by: =?utf-8?B?5YiY5piK?= | last post by:
Hi, folks, Is it possible to delete an element from a sorted array with O(1) time? Best regards
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.