Scheduler problem with scheduled events

2015-05-02 Thread mt1957

L.s.

Reading though synopsis S17 concurrency I tried the following

$*SCHEDULER.cue: in=10, { say 10s later }

which will deliver the string after 10 seconds. However the moar will 
work like hell at a 100% cpu time before and afterwards! Removing the 
option 'in' didn't show this problem.


Another option will show the same problem in the following code.

my $c = $*SCHEDULER.cue: :every(1), { say Oh wow, a kangaroo! };
sleep 10;
$c.cancel;

Canceling will stop the output of kangaroos but moar will keep on doing 
its thing at about 100% cpu time. I didn't found an option or method to 
stop that thread.



I am working with perl6 version 2015.04-5-g59f57a8 built on MoarVM 
version 2015.04-3-gbb50941


Greetings,
Marcel


Re: Scheduler problem with scheduled events

2015-05-02 Thread Elizabeth Mattijsen
 On 01 May 2015, at 13:57, mt1957 mt1...@gmail.com wrote:
 Reading though synopsis S17 concurrency I tried the following
 
 $*SCHEDULER.cue: in=10, { say 10s later }
 
 which will deliver the string after 10 seconds. However the moar will work 
 like hell at a 100% cpu time before and afterwards! Removing the option 'in' 
 didn't show this problem.
 
 Another option will show the same problem in the following code.
 
 my $c = $*SCHEDULER.cue: :every(1), { say Oh wow, a kangaroo! };
 sleep 10;
 $c.cancel;
 
 Canceling will stop the output of kangaroos but moar will keep on doing its 
 thing at about 100% cpu time. I didn't found an option or method to stop that 
 thread.

Thank you for reporting.  Yes, this is a known issue, potentially of the 
underlying libuv system.

BTW, it is generally thought not to be a good idea to directly call the 
scheduler directly like that. You probably want to use the Promise.in or the 
Supply.interval functionality to achieve the same effect.  And the same bug.  
Well, for now then.




Kind regards,

Liz