Jython, GILs and object locking.

Harri Pesonen fuerte at sci.fi
Sat Oct 18 16:06:24 EDT 2003


Aahz wrote:
> In article <FW7kb.63$MO7.35 at reader1.news.jippii.net>,
> Harri Pesonen  <fuerte at sci.fi> wrote:
> 
>>Aahz wrote:
>>
>>>In article <NmBjb.253$en5.245 at reader1.news.jippii.net>,
>>>Harri Pesonen  <fuerte at sci.fi> wrote:
>>>
>>>>Why? Each thread has its own variables, they are not shared, there is no 
>>>>need for synchronizing.
>>>
>>>Either you don't understand how Python currently works or you're talking
>>>about implementing a completely different language that happens to share
>>>syntax and some semantics with Python.  Which is it?
>>
>>Mostly the latter. It would be 99% compatible with the Python syntax, 
>>the only difference would be in threading. But it would be 
>>free-threading, not pseudo-threading as the current Python.
> 
> The point is that it would be at best 80% compatible with current
> Python's semantics.  CPython doesn't have "variables", it has names and
> objects; all objects are global within a single process.  Changing that
> semantic has implications far beyond threading.  There's also the issue
> that you keep refusing to address: making Python work with random
> third-party libraries that aren't thread-safe or thread-hot.

Sure Python has variables. You can call them objects if you like.

Objects are global only within one interpreter state. You can have 
several interpreter and thread states already in CPython.

Only a few static objects are global within a single process.

My version of Python will be for people who want free-threading. If your 
library needs GIL, then use the current Python.

Harri





More information about the Python-list mailing list