HELP! Obscure Python Reentrancy Question

Courageous jkraska at san.rr.com
Fri Feb 22 22:30:22 EST 2002


This is complicated, but I'll ellide this to the minimum
necessary for describing the problem.

1. Suppose you begin a C++ program.

2. This C++ program contains at its heart a scheduler which
manages cooperative thread states (specifically, Windows
Fibers, but just think "cooperative threads").

3. The C++ program occasionally dispatches to a bit of Python
code.

4. The Python code calls an external C++ function which
triggers the thread switch back to the scheduler.

5. The scheduler starts or resumes another thread, which
very likely will contain more Python, some of which has
been left in this intermediate state like this.

My test shows this going to hell in a handbasket. That
doesn't surprise me.

What now?

C//



More information about the Python-list mailing list