Assuming a simple java RMI system(Hello World), my question is, if I run 10 threads in client side to call the remote(server) object for something, does the target server will create 10 threads too? or they will be proceed through a queue or something?
The problem: there might be some concurrent call to remote object that it's possible one of them needs a notable time to process, so now should I take care about threading at server side or maybe there are some implementations available for this case.
Thanks in advance.
It isn't specified. All that the RMI Specification says is that there is no guaranteed association between client threads and server threads.
The occult meaning of this is that you can't assume it is single threaded.
How specific implementations behave is up to them. For example, Oracle's RMI/JRMP uses a new thread per accepted connection, no queuing, but this is alleviated by connection-pooling at the client. Last time I looked, IBM's used a thread pool, which implies a queue. There are other implementations.
In general the answer to your last question is that you don't have to do anything except ensure minimal but adequate synchronization.
EDIT Some comments on the links in @CyberneticTwerkGuruOrc's deleted answer, which refer to an obscure and obsolete framework built over RMI dated 2002:
Object.wait()
and a notifying thread to implement a timeout is crude in the extreme.shutdown()
method in the remote interface is a prima facie security breach.Activatable
for example.