A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-September/074679.html below:

[Python-Dev] Removing the GIL (Me, not you!)

[Python-Dev] Removing the GIL (Me, not you!)Talin talin at acm.org
Sat Sep 15 07:48:40 CEST 2007
Adam Olsen wrote:
> I'm now working on an approach that writes out refcounts in batches to
> reduce contention.  The initial cost is much higher, but it scales
> better too.  I've currently got it to just under 50% cost, meaning two
> threads is a slight net gain.

http://www.research.ibm.com/people/d/dfb/publications.html

Look at the various papers on 'Recycler'.

The way it works is that for each thread, there is an addref buffer and 
a decref buffer. The buffers are arrays of pointers. Each time a 
reference is addref'd, its appended to the addref buffer, likewise for 
decref. When a buffer gets full, it is added to a queue and then a new 
buffer is allocated.

There is a background thread that actually applies the refcounts from 
the buffers and frees the objects. Since this background thread is the 
only thread that ever touches the actual refcount field of the object, 
there's no need for locking.

-- Talin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4