This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benson_basis
Recipients
Date 2004-03-31.19:34:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When Py_DEBUG is turned on, PyThreadState_Swap 
calls in a fatal error if the two different thread states 
are ever used for a thread.

I submit that this is not a good check. The 
documentation encourages us to write code that 
creates and destroys thread states as C threads come 
and go. Why can't a single C thread make a thread 
state, release it, and then make another one later?

One particular usage pattern:

We have an API that initializes embedded python. Then 
we have another API where the callers are allowed to be 
in any C thread. The second API has no easy way to tell 
if a thread used for it happens to be the same thread 
that made the initialization call. As the code is written 
now, any code running on the 'main thread' is required 
to fish out the build-in main-thread thread state.
History
Date User Action Args
2007-08-23 14:20:44adminlinkissue926910 messages
2007-08-23 14:20:44admincreate