Several weeks ago there was this post:

That gave this example of perl6 N:M threads in action:

use v6.d.PREVIEW;

my $channel =;

my @ten_tasks = (^10).map: {
    start {
        my $thread = $*;
        await $channel;
        say "HOLY MOLEY SOMEONE STOLE MY THREAD" if $thread != $*;

$channel.send("Ring ring") for ^10;

await @ten_tasks;

It demonstrates that perl6 will not tie up a thread in the thread pool just
sitting around waiting (I think).

The example is intended to be condensed without any surplus code.
So my question is, is the $channel.close required? Leave it out and the
code still seems to work. Am I missing some subtle point?

Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.

Reply via email to