473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 974
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.