Question about Python threads
vvainio at tp.spt.fi
Tue Aug 27 08:56:58 CEST 2002
Greg Ewing <see_reply_address at something.invalid> wrote in message news:<3D6AE99C.5060202 at something.invalid>...
> a GIL. Even without refcounting, lack of a GIL would
> require locks around many other things, e.g. anything
> which mutates an object (inserting/deleting list
> items, etc.) Also object allocation, which I suspect
I don't think object mutation would be that much of a problem - it's
natural for programmers to *assume* that manupulating such data
structures is not thread safe, and expecting programmers to use
explicit mutexes or use thread safe versions of the objects wouldn't
really be too radical. At least I automatically assume that any
manipulation of common data is not threadsafe.
And Jython apparently does fine with gc, so it's not *entirely*
utopistic to wish that someday, by py4k, python threads could be
running on different processors. I don't know if it would be worth the
trouble in the near future.
More information about the Python-list