Quote:
|
Originally Posted by andhow
Quoting 29.2 in the documentation:
When it says "process a request from the server", does it mean a full synchronous method invocation from the server back to the client?
|
Yes.
Quote:
|
Originally Posted by andhow
Said differently, if I have two objects A and B using different communicators, and A::foo() calls B::bar(), then B::bar() calls A::bar() which does nothing but return, should this avoid deadlock if both communicators have Client and Server threadpool sizes of 1?
|
I'm not sure I understand the question, what should prevent the deadlock? The scenario you describe looks like the demo/Ice/callback, where the client is calling Callback::initiateCallback() on the server, and the server is calling back CallbackReceiver::callback() on the client. The thread pool sizes are set to 1 in the example and there's no deadlocks.
Quote:
|
Originally Posted by andhow
The reason I ask is I am getting different behavior. Both communicators have default (no configs used) thread pool sizes of 1 and are in different processes. In addition to synchronous method invocations, ice_ping() and checked_cast() deadlock as well. As expected raising the ThreadPool.MaxSize's fixes the problem.
|
If you have only one thread in the server thread pool to dispatch incoming requests and if this thread is currently busy waiting for a response from another invocation, ice_ping() or checkedCast() invocations on this server will hang. There's simply no more threads to process them.
We would need to know a bit more on your application to be able to figure out why you're getting a deadlock. Is it similar to the scenario you described where A::foo() calls B::bar(), then B::bar() calls back A::bar()? Are you locking any mutexes when doing these invocations?
The best way to quickly solve these problems is to get thread dumps of both processes and analyze the thread dumps. You can easily get thread dumps of a Java JVM by sending a SIGQUIT signal to the JVM process. For C++ processes, you need to attach the process with your favorite debugger. If you send me the thread dump of your client and server, I'll be happy to look at them to try to see where the deadlock is coming from.
Benoit.