a new PEP?

vm_usenet vm_usenet at yahoo.com
Sat Jan 4 16:34:37 EST 2003


Hello everyone!

I have recently had the pleasure to develop a large-scal system with
Python. Although the project went well, I did come across the fact
that not only Python is not really multithreaded (which you all know,
of course)- but it also does not support creation of multiple
interpreters and running them in seperate threads - which might come
in handy...

What I'm proposing is to dump the current approach of static/global
variables in the python source and to make the python interpreter
state-oriented. Thus we could use a (very pseudo) code like this:

PyInterpreter * new_interpreter = PyInterpreter_Create(...);
PyInterpreter * yetanother_interpreter = PyInterpreter_Create(...);

do_something_with_interpreter_on_first_thread(new_interpreter);
do_something_with_interpreter_on_other_thred(yetanother_interpreter);

currently, since the python thread state and other parameters are kept
global and static, these two threads would clash and burn. With a
slightly new design this code can work - and that could be very
useful.

Is there any way I can post this proposal to the PEP list?

P.S. 
In case you're wondering why we should need such a feature - imagine
an application powered by Python as an extension language - and then
running two extensions in two different threads. Not so far-fetched,
anyway...




More information about the Python-list mailing list