On Thu, Dec 06, 2007 at 01:07:21AM +0100, Jochen Stenzel <[EMAIL PROTECTED]> 
wrote:
> * I *could* stop the loop in the debugger today, but it took a while:

Although the behaviour is consistent with any other extension module for
perl, I tried to document this in the next EV release:

   =head1 PERL SIGNALS

   While Perl signal handling (C<%SIG>) is not affected by EV, the behaviour
   with EV is as with any other C library: signals will only be handled when
   Perl runs, which means your signal handler might be invoked only the next
   time an event gets handles.

   The solution is to use the the EV signal handlers (see C<EV::signal>). If
   you cannot do this for whatever reason, you can also force a watcher to be
   called on every iteration by installing a C<EV::check> watcher:

      my $async_check = EV::check sub { };

   This ensures that perl shortly gets into control for a short time.

Note, however, that this does not work for the perl debugger as the perl
debugger can only stop at the next perl statement to be executed - this is
a limitation of perl (or more precisely the debugger).

As this is also the exact same behaviour as with Event (or other event
loops), so I find it rather surprising that it needs mentioning, but
I hope the additional documentation is not wasted and actually proves
helpful to somebody.

(But then, signal handling does require knowledge of the underlying
operating system handling of signals).

-- 
                The choice of a
      -----==-     _GNU_
      ----==-- _       generation     Marc Lehmann
      ---==---(_)__  __ ____  __      [EMAIL PROTECTED]
      --==---/ / _ \/ // /\ \/ /      http://schmorp.de/
      -=====/_/_//_/\_,_/ /_/\_\      XX11-RIPE

Reply via email to