4
我需要有多個線程,每個線程從同一個套接字或從 $ * IN;然而,似乎有錯誤,因爲每個人都試圖從相同的來源閱讀(我認爲)。解決這個問題的最好方法是什麼?謝謝 !!perl6線程讀取干擾
my $x = start { prompt("I am X: Enter x: "); }
my $y = start { prompt("I am Y: Enter y: "); }
await $x, $y;
say $x;
say $y;
這裏是錯誤:
I am X: Enter x: I am Y: Enter y: Tried to get the result of a broken Promise
in block <unit> at zz.pl line 4
Original exception:
Tried to read() from an IO handle outside its originating thread
in block at zz.pl line 1
謝謝!
謝謝smls!我更新了Rakudo,錯誤消失了。而且我也會研究Lock類。非常感謝你 !! – lisprogtor