Skip to content
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

Fix a potential bug in thread joining. #88

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@shintaro-iwasaki
Copy link
Contributor

commented Feb 15, 2019

A while loop busy in ABT_thread_join waits until u_is_in_pool returns ABT_TRUE, though there is no guarantee that u_is_in_pool, which can be given by a user, is aware of memory ordering.

This patch adds a memory barrier to fix this issue. Note that this path is rarely taken so the additional barrier does not affect performance.

thread: add a memory barrier to a loop calling a user function
The while loop busy waits until u_is_in_pool returns ABT_TRUE, though there is
no guarantee that u_is_in_pool, which can be given by a user, is aware of memory
ordering.

This patch adds a memory barrier to fix this issue.  Note that this path is
rarely taken so the additional barrier does not affect performance.

@shintaro-iwasaki shintaro-iwasaki force-pushed the shintaro-iwasaki:FixEmptyWhileLoop branch from 0243b73 to 39a5706 Feb 15, 2019

@shintaro-iwasaki

This comment has been minimized.

Copy link
Contributor Author

commented Feb 25, 2019

test:jenkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.