Closed suzixin closed 6 months ago
This is not a complete program and it's not a proper bug report. You can't just dump your project and expect someone else to solve your problems, you need to specify an isolated problem with the library, not just "my project is not working, fix it".
it crash in this library clearly.
Any single threaded library will crash if misused from different threads, or if passed invalid references.
There's an arrogance I don't need. But I can say from your fraction of program that you probably mix threads for HttpWorker (the name implies multithreaded use).
But since you only posted a fraction of your program, nobody on Earth will know or want to know.
This is not a usable bug report
Thank you for pointing out this issue. It is indeed possible that multiple threads are calling the same instance's app_->publish("broadcast", message.dump(), uWS::TEXT)
. However, even after adding locks to protect this call, the problem persists. Could you advise on how best to utilize your internal synchronization mechanisms in this situation? I have tried reviewing the examples and documentation, but haven't found a clear approach. Any additional resources you could provide would be greatly appreciated.
A lock doesn't do anything for a library that is single-threaded. The only function you can call from many threads is Loop::defer it is mentioned in readmore manual.
Hi team
This is my program.
Program crash when
HttpWorker::send_message
was called too many times in a short time.