use threads;
use threads::shared;
my$foo = bless {}, 'Foo';
my $thr = threads->new(sub {})->detach;
package Foo;
sub DESTROY {
say 'Destroy! ', threads->tid;
}
use threads;
my $th1= threads->new( sub{return 1,3,5;} );
say $th1->join; # => 5
my ($th2) = threads->new( sub{return 1,3,5;} );
say $th2->join; # => 135
Marc Lehmann先生
Unlike theso-called "Perl
threads" ..., Coro provides a
full shared address space,
which makes communication
between threads very easy.
And coro threads are fast,
too