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

[std/channels] change the order of signal and unlock #17717

Merged
merged 1 commit into from
Apr 14, 2021
Merged

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Apr 14, 2021

Related #17392

The pthread_cond_broadcast() or pthread_cond_signal() functions may be called by a thread whether or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() have associated with the condition variable during their waits; however, if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or pthread_cond_signal().

Especially we need predictable scheduling behavior

if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or pthread_cond_signal().

@ringabout ringabout changed the title Update channels.nim [std/channels] change the order of signal and unlock Apr 14, 2021
@Araq Araq merged commit 58f44c8 into devel Apr 14, 2021
@Araq Araq deleted the xflywind-patch-1 branch April 14, 2021 14:45
@timotheecour
Copy link
Member

timotheecour commented Apr 18, 2021

@xflywind this PR makes sense and indeed improves #17392, see folowup notes in #17392 (comment)

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