> commit f410a2119920dd04690025a349e79575cfb9c972
> Author: Nicholas Clark <[email protected]>
> Date: Thu Apr 15 11:37:53 2010 +0100
>
> Move PERL_ASYNC_CHECK() from the runloop to control flow OPs.
>
> For the typical code this gives a 5% speedup, and removes the cost of "safe
> signals". Tight looping code will show less gains, but should never be
> slower.
>
> Subtle bugs might remain - there might be constructions that enter the
> runloop
> (where signals used to be dispatched) but don't contain any
> PERL_ASYNC_CHECK()
> calls themselves.
FYI,
Tests for my module Thread::Cancel started failing following this change.
The issue was my test threads used the following construct:
my $thr = threads->create(sub { while (1) { } });
When I tried sending signals to the thread, it didn't pick them up.
My fix was to make the 'test loop' more realistic.
sub test_loop
{
my $x = 1;
while ($x > 0) { threads->yield(); }
}
my $thr = threads->create('test_loop');