Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about multithreading in RMI

 
Daniel D. Guo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have finished the first draft the database access program and working on the networking part. I chose RMI. It seems what I need to do is to simply put the data class available on the RMI server. But my question is whether the RMI server will handle multiple clients concurrently?

Any reply is very welcome! Happy new year!

Dan
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

it might handle them concurrently. For any two distinct method calls, no matter wether or not they are from the same client or at the same time, it might use the same or different threads. Entirely up to the implementation, not specified.

Kai
[ December 30, 2005: Message edited by: Kai Witte ]
 
Daniel D. Guo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Per the requirement of my SCJD test, my data server should be able to handle multiple clients concurrently. Can this concurrency be handled by RMI server?

Thanks,
Dan
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Daniel,

RMI will give you a multi threaded network server, so yes, it can process multiple requests from multiple clients concurrently.

However this comes at a price - you, as the developer of the server, have to develop a thread safe server.

It is still very possible for a programmer to build their server application in such a way that negates the benefits of RMI and has little or no concurrency.

Regards, Andrew
 
Daniel D. Guo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Kai and Andrew.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic