i have an RMI application using simple rmi call, just passing few params to server and everything is looking fine. recently i was running it in eclipse in debug mode and i saw a strange thing. whenever i was calling this remote method, a new thread was being created, named "Selector Thread". Now i know that i am not creating it, and i just don't know how to stop it from being created. I am using a single global RMI object, there is no multiple remote interface object creation, it is just the call. is this normal?
is there a way to stop new threads from being created or the old one to simply stop or destroy itself?
RMI Servers handle multiple requests concurrently. The way it is done is with threads. Each new request runs in either a new thread, or it re-uses an existing thread. The RMI Runtime will destroy old threads after awhile.
There is a lot of information on exactly how this works on the internet. Just search.
Pat Farrell wrote:@ravi, why do you think this is a problem?
I assume you are using RMI for a school project and not for something real. RMI is a bad protocol, and should not be used for modern production programs.
well, unfortunately, it is part of an antique production software. I have to use RMI as their complete software is working on RMI. the issue is from the testing team, they are bugging me asking about this additional threads. I don't see this threads impacting the performance of my application, but they don't believe me..