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

Not thread safe #68

Closed
polomsky opened this issue Feb 10, 2015 · 4 comments
Closed

Not thread safe #68

polomsky opened this issue Feb 10, 2015 · 4 comments

Comments

@polomsky
Copy link

The code is vulnerable to race conditions. Try run with go run -race

One example for all:
broadcast type in adapter.go uses unsynchronized access to the map (Join, Leave, Send)

@Incisive
Copy link

One way I got it working was to wrap a mutex around calls to BroadcastTo. Another option would be to set up a buffered channel that a worker reads from and emits broadcasts from structs/data in the channel that way it doesn't block senders trying to send broadcasts.

@googollee
Copy link
Owner

I will try to figure out how to do it right.

@nkovacs
Copy link
Contributor

nkovacs commented Jan 14, 2016

I fixed the race condition in broadcast (Join/Send/Leave), but I couldn't find any others running the example app.

@erkie
Copy link
Collaborator

erkie commented Jun 11, 2018

Closing this issue because it is very broad. If you have any specific races please open separate tickets for them so it's easier to take a look at.

@erkie erkie closed this as completed Jun 11, 2018
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

No branches or pull requests

5 participants