[Python-Dev] Making python C-API thread safe (try 2)

Martin v. Löwis martin at v.loewis.de
Fri Sep 12 01:50:46 EDT 2003


Shane Hathaway <shane at zope.com> writes:

> - Copy the "1" object into shared memory before passing it to
> L.append().  This would be nice and transparent, but also a little
> DWIM.

That might work for the object 1, but some object simply couldn't be
copied, e.g. file objects, _tkinter objects, and so on.

> - Create special object types just for shared memory.

That might be feasible, but would not be valuable. You would have to
duplicate entire type hierarchies, and it would not convenient for
users to use this duplication.

> As it turns out, POSH (see Jeremy's link) takes the second strategy,
> apparently quite successfully!  Anyone who has concerns about the GIL
> should take a long, hard look at POSH.  It just might solve the
> problem for lots of people.

It's an interesting approach, but it remains to be seen whether it
really solves problems in real life.

Regards,
Martin





More information about the Python-list mailing list