• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI server...is it multi-threaded class??

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is RMI implictly working in a Multi-thread environment. When multiple client connect to the Server remote object, are they all accessing the same instance of the remote object or different instance. I feel very unclear in this aspect though I have many tutorial abt RMI, but none is clearly explain this.
Please help
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As far as I'm aware there are as many distinct instances of the remote object that you create and bind to a unique name in the registry.
So for instance. If you bind the same object to two different names in the registry then as far as I gather you are referencing the same object.
So as you say RMI is implicitly multithreaded - clients connect and call methods on the same instance of the remote object. Therefore this object needs to be threadsafe.
I hope this helps,
Cheers,
Steve
 
Steve Granton
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I found the following in the RMI Architecture and Functional Specification:


A method dispatched by the RMI runtime to a remote object implementation may or may not execute in a separate thread. The RMI runtime makes no guarantees with respect to mapping remote object invocations to threads. Since remote method invocation on the same remote object may execute concurrently, a remote object implementation needs to make sure its implementation is thread-safe.


Cheers,
Steve
 
reply
    Bookmark Topic Watch Topic
  • New Topic