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 random hang in non-blocking-queue #61448

Merged
merged 2 commits into from
Feb 2, 2024

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Feb 1, 2024

PR types

Bug fixes

PR changes

Others

Description

fix random hang in non-blocking-queue

First, num_tasks_ will be read/write both in two different threads, which may leads to data inconsistence, though it is atomic.
And, ec_.Notify(false); is able to fast return when no threads are waiting with a little time cost, so remove num_tasks_.

Pcard-76459

@zhiqiu zhiqiu merged commit 755b749 into PaddlePaddle:develop Feb 2, 2024
32 checks passed
Copy link
Contributor

@From00 From00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants