I am using websocket. It is simple and powerful. The websocket server application has two threads which broadcast to clients. Are they thread safe? If no, how can I make sure the two threads can broadcast?
Currently I use lock. when one thread is broadcasting, I turn on the lock. Is the solution ok?
I am not a professional Java program. I appreciate your kind help.
I am using websocket. It is simple and powerful. The websocket server application has two threads which broadcast to clients. Are they thread safe? If no, how can I make sure the two threads can broadcast?
Currently I use lock. when one thread is broadcasting, I turn on the lock. Is the solution ok?
I am not a professional Java program. I appreciate your kind help.