[Python-Dev] New thread death in test_bsddb3

Tim Peters tim.one@comcast.net
Fri, 02 May 2003 13:55:05 -0400


[Thomas Heller]
>>> ...
>>> So is the policy now that it is no longer *allowed* to create another
>>> thread state, while in previous versions there wasn't any choice,
>>> because there existed no way to get the existing one?

[Tim]
>> You can still create all the thread states you like; the new check is
>> in PyThreadState_Swap(), not in PyThreadState_New().

[Thomas]
> So you can create them,

Yes.

> but are not allowed to use them?

Currently, no more than one at a time per thread.  The API doesn't appear to
preclude using multiple thread states with a single thread if the right
dances are performed.  Offhand I don't know why someone would want to, but
people want to do a lot of silly things <wink>.

> (Should there be a smiley here, or not, I'm not sure)

No.

> ...
> I'm confused: what *is* the policy now?
> And: Has the policy *changed*, or was it simply not checked before?

I already gave you my best guesses about those (no, yes).

> Since I don't know the policy, I can only guess if the fatal error is
> appropriate or not.

Ditto (yes).

> If it is, there should be a 'recipe' what to do (even if it is 'use the
> approach outlined in PEP311').

Additions to NEWS and the PEP would be fine by me.

> If it is not, the error should be removed (IMO).

Sure.