I just killed GIL!!!

sturlamolden sturlamolden at yahoo.no
Thu Apr 17 13:05:00 EDT 2008


On Apr 17, 6:03 pm, Rhamphoryncus <rha... at gmail.com> wrote:

> Interesting.  Windows specific, but there's other ways to do the same
> thing more portably.

I believe you can compile Python as a shared object (.so) on Linux as
well, and thus loadable by ctypes.

> The bigger issue is that you can't share any objects.

Why not?


> This
> effectively gives you a multiprocess model - a bit cheaper than that,
> but not enough to really supply GIL-free threading.

That solution is safe. But I am looking into sharing objects. I don't
think its impossible.

PyObject* pointers can be passed around. GILs can be acquired and
released, refcounts increased and decreased, etc. but we have to sort
out some synchronization details for the shared objects. For one
thing, we have to make sure that a garbage collector does not try to
reclaim a PyObject* belonging to another interpreter. But here we are
talking about minor changes to CPython's source, or perhaps none at
all.













More information about the Python-list mailing list