… | |
… | |
26 | |
26 | |
27 | $b->resume; # the first resume is slow because it allocates all the memory |
27 | $b->resume; # the first resume is slow because it allocates all the memory |
28 | |
28 | |
29 | $main = $Coro::main; |
29 | $main = $Coro::main; |
30 | |
30 | |
31 | sub transfer { |
31 | #*transfer = \&Coro::_transfer; |
32 | Coro::_transfer($_[0], $_[1]); |
32 | sub transfer { Coro::_transfer($_[0], $_[1]) } |
33 | } |
|
|
34 | |
33 | |
35 | $c = Coro::_newprocess { |
34 | $c = Coro::_newprocess { |
36 | while() { |
35 | while() { |
37 | transfer($c, $main); transfer($c, $main); transfer($c, $main); |
36 | transfer($c, $main); transfer($c, $main); transfer($c, $main); |
38 | } |
37 | } |