synchronized RMI method call?

D

Digital Puer

In RMI, if I make the remote mehod "synchronized," is it guaranteed
that only one client can enter that method at a time? I read
somewhere that this was not guaranteed (surprisingly).
Thanks for any info.
 
R

Roedy Green

In RMI, if I make the remote mehod "synchronized," is it guaranteed
that only one client can enter that method at a time? I read
somewhere that this was not guaranteed (surprisingly).

how could it not?

The calls to the stub in various remotes can proceed to send off their
RMI packets, but the threads will have to line up in the server to
lock that object.
 
E

EJP

Digital said:
In RMI, if I make the remote mehod "synchronized," is it guaranteed
that only one client can enter that method at a time? I read
somewhere that this was not guaranteed (surprisingly).

No you didn't, you read that there is no guaranteed relationship between
client threads and server threads in RMI, so as to allow the RMI runtime
to use the same server thread sequentially for multiple client threads
if it so desires. 'synchronized' still does what the language
specification says, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top