I just killed GIL!!!
sturlamolden at yahoo.no
Thu Apr 17 19:33:26 CEST 2008
On Apr 17, 7:16 pm, Jonathan Gardner <jgard... at jonathangardner.net>
> On Apr 17, 8:19 am, sturlamolden <sturlamol... at yahoo.no> wrote:
> > An there you have the answer. It's really very simple :-)
> That's an interesting hack.
> Now, how do the processes communicate with each other without stepping
> on each other's work and without using a lock?
Why can't I use a lock?
There is a big difference between fine-grained locking on each object
(cf. Java) and a global lock for everything (cf. CPython's GIL). Fine-
grained locking for each object has been tried, and was found to be a
significant slow down in the single-threaded case.
What if we just do fine grained locking on objects that need to be
What if we accept that "shared" objects are volatile and may suddenly
disappear (like a weakref), and trap that as an exception?
More information about the Python-list