Closed moshen closed 7 years ago
Unfortunately, it's not so simple as the example. The worker servers need to communicate, and the documentation does not declare what is thread-safe. However, I got an answer from the author in https://github.com/uWebSockets/uWebSockets/issues/244 and was able to implement an (ugly) multi-threaded implementation.
That said, it doesn't seem to make much difference for a simple broadcast benchmark. I think it is hitting the a OS/networking stack/network ceiling.
The uWebSockets server implementation is single threaded. Please take a look at the uWebSockets multi-threaded example.