Hello Marc,

>> Then I run a simple loop in the debugger (on the same system), with just
>> one periodic watcher. Surprisingly, once started I could not interrupt
>> the loop via CTRL-C.
> 
> That is interesting. I am not aware that solaris event ports would block
> any signals, and in fatc, I cannot reproduce this. Are you sure that your
> tty settings actually do anything with CTRL-C (such as sending an INT)?

I am - I retried it today, other programs receive the signal and the
effect is the same if I send the signal via kill from another terminal.

I know the following is an incomplete report as it does not contain
exact system information (in general, Solaris 5.8) and perl version (in
general, 5.8.6 without thread support), but today the picture was a bit
different:

* I *could* stop the loop in the debugger today, but it took a while:

  DB<2> sub d {print "===> TIME: ", time, "\n";}

  DB<3> d
===> TIME: 1196849803

  DB<4> use EV

  DB<5> $p=EV::periodic(0, 10, 0, sub {print "Periodic call at ", time,
".\n"})

  DB<6> d(); EV::loop
===> TIME: 1196849839
Periodic call at 1196849839.
Periodic call at 1196849840.
Periodic call at 1196849850.
Periodic call at 1196849860.
Periodic call at 1196849870.
^Cd
Periodic call at 1196849880.
EV::loop((eval 32)[.../perl5db.pl:628]:2):
2:
  DB<<7>> d
===> TIME: 1196849890



* so, CTRL-C worked this time ...
* ... but not immediately (as usual, instead it took until the next
  watcher event, plus the time to the next event check (as it seems)).
  This was verified with longer intervals and it was reproducable.
* In contrast, with an additional signal watcher the signal is
  handled instantly.
* By the way, there *were* cases today when the signal was ignored
  completely, this time in a script where I had to add an explicit
  signal watcher to make it interruptable at all. I hope to shrink
  this down to a short demo script to send.


Another interesting effect you might be interested in was this:

  DB<1> use EV

  DB<2> $p=EV::periodic(0, 2, 0, sub {print "Periodic call with short
intervall at ", time, ".\n"})

  DB<3> EV::loop
Periodic call with short intervall at 1196850121.
Periodic call with short intervall at 1196850122.
Periodic call with short intervall at 1196850124.
Periodic call with short intervall at 1196850126.
^CPeriodic call with short intervall at 1196850128.
EV::loop((eval 23)[.../perl5db.pl:628]:2):
2:
  DB<<4>> $p=EV::periodic(0, 20, 0, sub {print "Periodic call with
longer intervall at ", time,
".\n"})

  DB<<5>> EV::loop
Periodic call with longer intervall at 1196850145.
Periodic call with short intervall at 1196850145.
Periodic call with short intervall at 1196850146.
Periodic call with short intervall at 1196850148.
Periodic call with short intervall at 1196850150.
Periodic call with short intervall at 1196850152.
Periodic call with short intervall at 1196850154.
Periodic call with short intervall at 1196850156.
Periodic call with short intervall at 1196850158.
Periodic call with longer intervall at 1196850160.
Periodic call with short intervall at 1196850160.
^CPeriodic call with short intervall at 1196850162.


So, a periodic watcher with a short interval was assigned to a variable,
then the loop was started and interrupted via CTRL-C. After that a new
watcher was installed and assigned to the same variable, which - as I
understood the docs - should uninstall the first watcher as now there
was no further reference to the first watcher object. But when running
the loop again *both* watchers were present.


Finally, in both traces one sees a first callback invocation that does
not fit into the periodic scheme.


I am not sure when I wil have time to send a demo script for the
mentioned case of an ignored interrupt but I hope the traces give you a
first impression.

               Jochen














Reply via email to