You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to my understanding, HttpServer creates multiple threads and listens with them detached from the main thread. And it should be possible to use multiple HttpClient's with a single server and concurrently. Is that correct?
I've created example code which starts a server and then does two "long" RPC calls from two separate threads to the server.
This sometimes (not always) results in a deadlock, where apparently only one of the calls is made and the other blocks before the server's method is called. In the example code, "Wait called" is then logged only once, and the code blocks until the HttpClient times out.
Is this a bug or expected behaviour? If the latter, what exactly is my example code doing wrong? Thanks a lot!
The text was updated successfully, but these errors were encountered:
I've updated my gist now to further figure out what is happening. In the new version, the server is running in a separate process and each HttpClient and RPC client is only created and used from the thread that is doing the call.
I still see a deadlock sometimes on the client side. When that happens, the server is fine, and can be called just fine from another process. So this must be some bug (or error in my usage) of the HTTP client in libjson-rpc-cpp.
According to my understanding,
HttpServer
creates multiple threads and listens with them detached from the main thread. And it should be possible to use multipleHttpClient
's with a single server and concurrently. Is that correct?I've created example code which starts a server and then does two "long" RPC calls from two separate threads to the server.
This sometimes (not always) results in a deadlock, where apparently only one of the calls is made and the other blocks before the server's method is called. In the example code, "Wait called" is then logged only once, and the code blocks until the
HttpClient
times out.Is this a bug or expected behaviour? If the latter, what exactly is my example code doing wrong? Thanks a lot!
The text was updated successfully, but these errors were encountered: