HELP! Obscure Python Reentrancy Question

Michal Wallace sabren at manifestation.com
Sat Feb 23 09:13:56 EST 2002


On Sat, 23 Feb 2002, Courageous wrote:

> I didn't think that Python was structured to allow
> multiple interpreters in a single process?

I know python can do this because mod_python uses this
feature.

Also, this may be completely irrelevant, but I had problems
connecting a callback in a C extension to python. I was
hooking up a MIDI keyboard to python. I could play notes
just fine from python to the keyboard, but when I tried to
go the other way (hitting a key on the keyboard), it
triggered a callback into my extension module, and that
screwed up the python interpreter.

The solution had something to do with the python interpreter
lock. I forget how it worked. I stole the code from someone
else. But if it helps, the code is online at:

  http://sabren.net/code/python/midi/winmidi/winmidi.cpp


Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com 
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------





More information about the Python-list mailing list