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

Christopher A. Craig list-python at ccraig.org
Wed Sep 17 10:08:05 EDT 2003


Harri Pesonen <fuerte at sci.fi> writes:

> But wouldn't it be better if Python had real multitasking? Comments
> like the above mean that you accept Python as it is, fine. But
> usually people want to make things better when they see that
> something can be improved. If my roof is leaking, I have two
> choices: fix it or accept it. If I am able to fix it, then I'll
> probably do it.

This is awfully dramatic.  Python does have real multitasking, take a
look at os.fork().  

Your proposal would require a great deal of work [1] to achieve a very
limited result: Situations where people wanted to share Python objects
between multiple, independent interpreters in a single process.  I
don't think that happens very often.  Note that the average threaded
Python user is probably using a single interpreter and so will see no
noticeable speedup from this.

If you really want to do this, I'd rather see some sort of shared
memory manager that lets you share Python objects between independent
processes.  That gives nearly all the benefits without having to break
a bunch of C modules.

1) You say it's easy, but I'll believe it when I see a patch.

-- 
Christopher A. Craig <list-python at ccraig.org>
I develop for Linux for a living, I used to develop for DOS.  Going from
DOS to Linux is like trading a glider for an F117. - Lawrence Foard







More information about the Python-list mailing list