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 bounded queue example to use Condition.broadcast #185

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

polytypic
Copy link
Collaborator

Using Condition.signal is not correct in these cases, because it is possible that multiple fibers manage to start Condition.wait and a single Condition.signal does not wake up all of them. Another alternative would be to Condition.signal every time the queue is not empty or is not full.

Using `Condition.signal` is not correct in these cases, because it is possible
that multiple fibers manage to start `Condition.wait` and a single
`Condition.signal` does not wake up all of them.  Another alternative would be
to `Condition.signal` every time the queue is not empty or is not full.
@polytypic polytypic force-pushed the fix-bounded_q-example branch from 609667e to e5c474e Compare July 22, 2024 15:56
winner := 3);
(fun () ->
Control.sleep ~seconds:0.5;
Control.sleep ~seconds:1.5;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Timeout increased to reduce flakiness.

@polytypic polytypic merged commit f5a5189 into main Jul 22, 2024
6 checks passed
@polytypic polytypic deleted the fix-bounded_q-example branch July 22, 2024 17:31
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.

1 participant