RE: Threads signalling issue [was RE: threads change]
[email protected] ("Jan Dubois")
| Newsgroups | perl.perl5.porters,perl.ithreads |
|---|---|
| Message-ID | <020401c6a7ed$62aa3f10$27febd30$@com> |
On Fri, 14 Jul 2006, Nicholas Clark wrote: > Signals are per process (unless I'm confused) That is correct, but PL_sig_pending and PL_psig_pend are still per- interpreter variables, so there is still no race condition. OS level signals are always delivered to the current interpreter in the main thread. I do wonder though what would happen if you had an embedding application that does not host a Perl interpreter in the main thread. dTHX in Perl_sighandler() should then set my_perl to NULL, generating an access violation. On Windows there is code to explicitly use PL_curinterp in this case (win32_signal_context() in win32/win32.c, via PERL_GET_SIG_CONTEXT). I don't understand why this isn't necessary on Unix. Cheers, -Jan