Message169008
I'm not sure it makes sense to call this new API "PyGILState_EnsureEx". My concern is that the behaviour is quite different in the presence of an existing thread state:
Ensure:
- if a thread state exists, use that interpreter
- otherwise, use the default interpreter configured in the pystate.c globals
New API:
- if a thread state exists, and the interpreter doesn't match the requested one, fail with an error
- otherwise, use the requested interpreter
I guess it makes sense if we treat the NULL pointer as the degenerate case meaning "use the interpreter of this thread, or the default interpreter if no interpreter has been declared for this thread". PyGILState_Ensure would then simply call PyGILState_EnsureEx(NULL) internally.
So, my question for Graham would be, given this ability, would mod_wsgi still need the ability to change the default interpreter? Or would it be enough for you to be able to register the threads *you* create with a specific interpreter? |
|
Date |
User |
Action |
Args |
2012-08-24 12:35:56 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, grahamd, asvetlov |
2012-08-24 12:35:56 | ncoghlan | set | messageid: <1345811756.54.0.301559045079.issue15751@psf.upfronthosting.co.za> |
2012-08-24 12:35:56 | ncoghlan | link | issue15751 messages |
2012-08-24 12:35:55 | ncoghlan | create | |
|