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

Possible multithread bug in message queue #17

Open
green-coder opened this issue Jun 19, 2016 · 3 comments
Open

Possible multithread bug in message queue #17

green-coder opened this issue Jun 19, 2016 · 3 comments

Comments

@green-coder
Copy link

green-coder commented Jun 19, 2016

This queue is used by multiple threads but I am afraid that the Queue class it is not thread safe.

@doctorpangloss
Copy link
Member

I'll investigate to what extent this is an issue. Unity is single threaded and this is their code borrowed from their websocket wrapper around web-socket-sharp. Broadly speaking, it should be possible to just use lock around accesses to the queue but I don't know if that's necessary...

@green-coder
Copy link
Author

I do think that there are multiple threads, but I don't know if your use of the Queue class will be problematic or not.

FYR, I implemented a DDP-client for Unity3D recently, and I used this class for the queue. Maybe that class can help you.

@doctorpangloss
Copy link
Member

I know this is a stale issue, but I believe today, there is an issue with using the regular queue class with the current websocketsharp lib. I have been using the exact ConcurrentQueue implementation from 4.0.0.0 mscorlib (Microsoft's code) and I'll port it into the package here soon.

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

2 participants