• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

threading issues in rmi server

 
Dushy Inguva
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
I have a question about threading issues @ the server side in RMI
How does the jvm handle requests at the server side? I mean does it use a separate thread for every client? Can i ask it to use a thread pool?
Without correct threading model at the serverside, (if it uses a new thread per request and kills it after the request is done), we would have lots of scalability issues. I know this is not a major concern for the exam, but just a thought !!!
Dushy
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that the RMI spec avoids making any commitment to how or if threads are used - the goal apparently is to allow implementations the freedom to optimize as they see fit. So in general, no you can't controll this in any standard way. It's quite possible that some Java implementations allow you to control this though; I dunno. I believe that some sort of thread pooling is the default in the current J2SDK 1.4.2, as I've used Thread.currentThread() to identify thread IDs, and have observed that there's certainly more than one thread used, but threads can and do get reused on differerent clients. I don't know any other details how or if this can be controlled however. If you don't get a good answer to that from someone else, you may wish to ask the question in the "Distributed Java" forum. Then let us know what you find out. Hope that helps...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic