Python Interpreter Reentrancy?

Aahz Maruch aahz at panix.com
Sun Apr 22 11:53:57 EDT 2001


In article <p9r5etcf78818e4ofhu92b1hd5al8ohh5s at 4ax.com>,
Courageous  <jkraska1 at san.rr.com> wrote:
>
>What progress has been made on the reentrancy of the Python interpreter
>vice the "global interpreter lock"? Is it possible to run python code
>embedded in a C application with multiple concurrent OS threads, each
>running time-sliced parallel python scripts, or is that capability
>still in progress?

I'm not quite sure what you're asking for.  It's certainly the case that
multiple threads in a C application can call Python code, but each time
you call into Python, you need to acquire the GIL first (along with first
making sure that you've done all the proper initialization).  In theory,
you could give each thread its own Python interpreter, but that has not
been done in practice AFAIK (and would suck up a lot of memory).
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het Pythonista   http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"Beware of companies that claim to be like a family.  They might not be
lying."  --Jill Lundquist



More information about the Python-list mailing list