• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI and Synchronization

 
mayuresh chaubal
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scene 1 :
In STUB, I have a synchronized method.
When multiple clients download the stub and call the method, I can see the calls are synchronized, (ie no 2 thread are accessing internal method code at same time).
Scene 2 :
Stub method is not synchronized.
But, it calls methodA() of singleton object, and methodA() is synchronized.
Internally methodA() a does some time consuming work.
Again, when multiple clients call the stub method (which internally calls methodA()), i see that code inside methodA() is thread safe.
Above thing worked on both windows and linux.

Question:
1. In scene 1, is the implementaion specific to vm version,flavour,os ??
can someone lead me to specific documentation which describes internal behavior ?
2. In scene 2, isn't the singleton object serialized and copied down to client vms ??

If not can someone point to sun documents describing the behaviour ??

Thanks in advance ..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic