Message141043
| Author |
neologix |
| Recipients |
michael.foord, neologix, pitrou, vstinner |
| Date |
2011年07月24日.12:32:30 |
| SpamBayes Score |
1.6514567e-13 |
| Marked as misclassified |
No |
| Message-id |
<CAH_1eM27amMVKH0k9wvNB79b_=vd0WG8x5EKV==iXP06nScnLA@mail.gmail.com> |
| In-reply-to |
<1311462842.3001.10.camel@localhost.localdomain> |
| Content |
> No, it's a feature of the new GIL.
When I look at 2.7's code, I see something different - _Py_Ticker is
reset in Py_AddPendingCall():
int
Py_AddPendingCall(int (*func)(void *), void *arg)
{
[...]
/* signal main loop */
_Py_Ticker = 0;
pendingcalls_to_do = 1;
[...]
}
And there's a comment in the main eval loop which confirms this:
/* Do periodic things. Doing this every time through
the loop would add too much overhead, so we do it
only every Nth instruction. We also do it if
``pendingcalls_to_do'' is set, i.e. when an asynchronous
event needs attention (e.g. a signal handler or
async I/O handler); see Py_AddPendingCall() and
Py_MakePendingCalls() above. */
So, AFAICT, signal handlers will get called right away (and if I
remove the _Py_Ticker reset from Py_AddPendingCall(), then those tests
fail consistently on Linux).
Or am I missing something?
Concerning the original problem, here's a patch implementing the second idea:
- getpid() is called after each kill(getpid(), <signum>), to "force"
the signal delivery
- the test is now re-enabled on FreeBSD6
I think this should fx the problem on both FreeBSD6 and OpenSolaris,
but since I don't have a FreeBSD or OpenSolaris box at hand, I
couldn't test it. Shall I try to commit it and see what the buildbots
say? |
|