New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrent threads report same Thread ID post-await #6390
Comments
From emmiller@gmail.comI'm using the new scheduler behavior described here: After an "await" on a managed (non-main) thread it appears that execution Here's a script that demonstrates the issue 50% of the time. This starts Expected behavior: Each thread should report its current, post-await Actual behavior: Each thread continues to report its pre-await $*THREAD.id Possibly related, per IRC conversation: ./perl6 --version use v6.d.PREVIEW; my $channel = Channel.new; my $promise1 = start { my $promise2 = start { my $promise3 = start { sleep 3; await $promise1, $promise2, $promise3; |
From @jnthnOn Tue, 11 Jul 2017 15:30:40 -0700, emmiller@gmail.com wrote:
Nice find. Dynamic variable lookups in MoarVM are cached, to improve lookup speed. However, the cache was not being invalidated when a continuation was taken (continuations being the mechanism underlying non-blocking `await`), and so an earlier resolution of `$*THREAD` was being re-used after the `await`. Fixed by invalidating the cache (which could conveniently and cheaply be done while walking the call stack to locate the continuation tag). Test added to the Rakudo test suite (t/02-rakudo/09-thread-id-after-await.t), since that allowed for a concise and more reliable test. /jnthn |
The RT System itself - Status changed from 'new' to 'open' |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#131740 (status was 'resolved')
Searchable as RT131740$
The text was updated successfully, but these errors were encountered: