develooper Front page | perl.perl5.porters | Postings from January 2001

Re: Does perl really need to use sigsetjmp? (18% performance hit)

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
January 9, 2001 09:16
Subject:
Re: Does perl really need to use sigsetjmp? (18% performance hit)
Message ID:
200101091715.RAA26167@mikado.tiuk.ti.com
Alan Burlison <Alan.Burlison@uk.sun.com> writes:
>Nick Ing-Simmons wrote:
>
>> Apparently not. I cannot at present think what sigsetjmp() gains
>> us. Do you have an guidelines which say "use sigsetjmp() if your code does X?"
>
>In perl terms, I think the only time this would happen is if you did a
>die inside a signal handler, and expected to go back to an enclosing
>eval() with the signal handler restored.  

I am sure we could do something special round perl signal handlers
and leave the vast bulk of other eval {} / G_EVAL code using 
normal setjmp().

Unless there is a more obvious/portable mechanism to save/restore the
mask then something like:

void 
invoke_handler(...)
{
 code = sigsetjmp(...);
 if (!code)
  {
   perl_call_xxx(...,G_EVAL|G_VOID);
   if (SvTRUE(PL_errsv))
    siglongjmp(...,1);
  }
}

should do it.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About