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.
<br><br>Thanks<br>Andre<br><br><br><div><span class="gmail_quote">On 9/18/06, <b class="gmail_sendername">"Martin v. Löwis"</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Andre Meyer schrieb:<br>> While I understand the difficulties in removing the GIL and the<br>> potential negative effect on single-threaded applications I would very<br>> much encourage discussion to seriously consider removing the GIL (maybe
<br>> optionally) in Py3k. If not, what alternatives would you suggest?<br><br>Encouraging "very much" is probably not good enough to make anything<br>happen. Actual code contributions may, as may offering a bounty
<br>(although it probably depends on the size of the bounty whether anybody<br> wants to collect it).<br><br>The alternatives are very straight-forward:<br>1. use Python the same way as you did for Python 2.x. I.e. create
<br> many threads, and have only one of them run. Use the other processors<br> for something else, or don't use them at all.<br>2. use Python the same way as many other people do. Don't use threads,<br> instead use multiple processors, and some sort of IPC.
<br>3. don't use Python, at least not for the activities that need to<br> run on multiple processors.<br>If you want to fully use your multiple processors, depending on the<br>application, I'd typically go with option 2 or 3. Option 2 if the code
<br>to parallelize is written in Python, option 3 if it is written in C<br>(yes, you can use multiple truly concurrent threads in Python: just<br> release the GIL on the C level; you can't make any calls into Python<br> until you reacquire the GIL).
<br><br>Regards,<br>Martin<br></blockquote></div><br><br clear="all"><br>-- <br>Dr. Andre P. Meyer <a href="http://python.openspace.nl/meyer">http://python.openspace.nl/meyer</a><br>TNO Defence, Security and Safety
<a href="http://www.tno.nl/">http://www.tno.nl/</a><br>Delft Cooperation on Intelligent Systems <a href="http://www.decis.nl/">http://www.decis.nl/</a><br><br>Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. - Douglas Adams