I just killed GIL!!!

Jonathan Gardner jgardner at jonathangardner.net
Thu Apr 17 13:19:11 EDT 2008


On Apr 17, 9:48 am, sturlamolden <sturlamol... at yahoo.no> wrote:
> On Apr 17, 5:46 pm, Hrvoje Niksic <hnik... at xemacs.org> wrote:
>
> > Have you tackled the communication problem?  The way I see it, one
> > interpreter cannot "see" objects created in the other because they
> > have separate pools of ... everything.  They can communicate by
> > passing serialized objects through ctypes, but that sounds like the
> > solutions that use processes.
>
> I see two solutions to that.
>
> It is possible to use fine-grained locking on the objects that need to
> be communicated.

And you'll pay a price for every lock/unlock operation, in addition to
the added complexity of the code (which you are already beginning to
see.) That's been tried in Python, and everyone agreed that the GIL
was the better compromise.

> The other option is to use serialized Queues like the processing
> module in cheese shop.

You mean pipes, files, and sockets?

You should check out Stackless's channels. Not a new or unique
concept, but a very powerful one that everyone should be familiar with.



More information about the Python-list mailing list