Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A threading question related to RMI  RSS feed

 
David Buchwald
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When an instance of the implemention is registered (Naming.rebind(url, instance of implementation)), only one instance is registered. If multiple threads in the client do Naming.lookup(url) to hook up with the implemention via Stub and Skel, are all the client threads working against the same instance of the implementation in the rmi server? Therefore, the implementation instance has to be thread safe.
What do you think?
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think that sounds correct. Another way you could possibly enhance this is to keep your client connects to a single class that does all the interactions. Then you could just make that class's methods synchronized. That pulls the burdon off of your "server"(implementation) and brings it back to the client side.
Your call tho if this will help you at all,
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!