Thread Unerwartete Ergenisse mit Promise.start
(10 answers)
Opened by Kuerbis at 2015-09-02 12:52
Oder so:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 #!/usr/bin/env perl6 use v6; my $n = 25_000; my $runs = 1; my $result; for ^$n { $result += $_ ** $_ } say $result; for ^$runs { my $sum = [+] await map { start { $_ ** $_ } }, ^$n; say "$sum $_"; die $_ if $sum != $result; } |