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

sync: add example for Cond #24952

Closed
kevinburke opened this issue Apr 19, 2018 · 3 comments
Closed

sync: add example for Cond #24952

kevinburke opened this issue Apr 19, 2018 · 3 comments

Comments

@kevinburke
Copy link
Contributor

It would be nice to have a complete example for the Cond struct - signaling or broadcasting from one goroutine, and receiving it in another one.

@ianlancetaylor
Copy link
Contributor

It's been tried before. I'm pretty ambivalent. The problem is that Go has better mechanisms for every simple use of a sync.Cond. To get any benefit from a sync.Cond you need a relatively complex use case that is difficult to show in an example. Personally I'm reluctant to write an example showing a simple use case of sync.Cond, because that implies that it would be a good choice for that simple use case, which I believe is not the case.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Apr 19, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 19, 2018

Duplicate of #20491.

@bcmills bcmills closed this as completed Apr 19, 2018
@kevinburke
Copy link
Contributor Author

OK

@golang golang locked and limited conversation to collaborators Apr 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants