[Python-3000] Kill GIL?
meyer at acm.org
Mon Sep 18 21:18:29 CEST 2006
I would love to contribute code for this problem. Unfortunately, I am not
able to do so, but see the problem for myself and others. Therefore, I
wanted to raise the question in time for Py3k. The number of responses
indicates that it is not just me who struggles and there are people who know
how to improve the situation. So far, this seems like a fruitful discussion.
On 9/18/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Andre Meyer schrieb:
> > While I understand the difficulties in removing the GIL and the
> > potential negative effect on single-threaded applications I would very
> > much encourage discussion to seriously consider removing the GIL (maybe
> > optionally) in Py3k. If not, what alternatives would you suggest?
> Encouraging "very much" is probably not good enough to make anything
> happen. Actual code contributions may, as may offering a bounty
> (although it probably depends on the size of the bounty whether anybody
> wants to collect it).
> The alternatives are very straight-forward:
> 1. use Python the same way as you did for Python 2.x. I.e. create
> many threads, and have only one of them run. Use the other processors
> for something else, or don't use them at all.
> 2. use Python the same way as many other people do. Don't use threads,
> instead use multiple processors, and some sort of IPC.
> 3. don't use Python, at least not for the activities that need to
> run on multiple processors.
> If you want to fully use your multiple processors, depending on the
> application, I'd typically go with option 2 or 3. Option 2 if the code
> to parallelize is written in Python, option 3 if it is written in C
> (yes, you can use multiple truly concurrent threads in Python: just
> release the GIL on the C level; you can't make any calls into Python
> until you reacquire the GIL).
Dr. Andre P. Meyer http://python.openspace.nl/meyer
TNO Defence, Security and Safety http://www.tno.nl/
Delft Cooperation on Intelligent Systems http://www.decis.nl/
Ah, this is obviously some strange usage of the word 'safe' that I wasn't
previously aware of. - Douglas Adams
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-3000