Hi,
Yes, I'm able to reproduce this. Try increasing the server thread pool size instead, with the following property:
Ice.ThreadPool.Server.Size=10
In the server, the response for invocations on the bidirectional connection is received by the server thread pool (not by the client thread pool). If all the server thread pool threads are busy dispatching calls, the response can't be received and therefore the invocation on the bidirectional connection hangs until its response can be received (or until it times out).
This is what is happening here. There's only one thread by default in the server thread pool. When the deadlock occurs, the server thread is dispatching the CallbackSenderI::addClient() method and it blocks waiting to acquire the mutex. However, the mutex can't be acquired because it's held by the sender thread in the run() method which is itself blocked waiting for the response of the callbacak() invocation...
Increasing the number of threads in the server thread pool will fix the issue. A better solution would be to modify the CallbackSenderI::run() method implementation to not lock the mutex while invoking on the callback receiver proxy.
Thanks for pointing this out, we'll look into changing this demo for the upcoming releases to fix this deadlock!
Cheers,
Benoit.