Author Rhamphoryncus
Recipients Rhamphoryncus, amaury.forgeotdarc, gregory.p.smith, gvanrossum
Date 2008-01-17.23:04:40
SpamBayes Score 2.57217e-05
Marked as misclassified No
Message-id <1200611082.32.0.993893085682.issue1856@psf.upfronthosting.co.za>
In-reply-to
Content
> Adam, did you notice the change on revision 59231 ? the
> PyGILState_Ensure stuff should now remain valid during the
> PyInterpreterState_Clear() call.

That doesn't matter.  PyGILState_Ensure needs to remain valid *forever*.
 Only once the process is completely gone can we be sure it won't be called.

Note that PyGILState_Ensure has two behaviours: it can be called when
your thread is already running python code and has a tstate, or it can
be called when you have none.  revision 59231 fixed the former, but only
when Py_Finalize hasn't finished.  It doesn't fix it for any daemon
threads, or for dummy threads (created outside of python's control).

...

You're right, I did forget the 3 other places that acquire the
interpreter_lock.  The more I think about it the more I think our two
approaches are equivalent, but conditionalizing the release means we
don't need to touch the broken PyThread_exit_thread functions.

I think the banning should be as early as possible, right after
call_sys_exitfunc() has finished.  You can't do anything sane once the
interpreter is half-gone (despite the precedent of trying anyway.)
History
Date User Action Args
2008-01-17 23:04:42Rhamphoryncussetspambayes_score: 2.57217e-05 -> 2.57217e-05
recipients: + Rhamphoryncus, gvanrossum, gregory.p.smith, amaury.forgeotdarc
2008-01-17 23:04:42Rhamphoryncussetspambayes_score: 2.57217e-05 -> 2.57217e-05
messageid: <1200611082.32.0.993893085682.issue1856@psf.upfronthosting.co.za>
2008-01-17 23:04:41Rhamphoryncuslinkissue1856 messages
2008-01-17 23:04:41Rhamphoryncuscreate