• Post Reply Bookmark Topic Watch Topic
  • New Topic

[RMI] Is the thread blocked?

 
Vinod Chandana
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I have question. Consider the following code.
rmihandl.execfun(obj1);
localobj.fun(obj2);
where the first line is a rpc call. Now if will the second line be executed after the first line is complete i.e. will the current thread wait for the completion of remote method or will it continue. I think the current thread will not wait. But do let me know if I'm wrong.
I guess if the remote method is returning smthg then the current thread will wait.
Thanks,
Vinod.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinod -
I'd hazard an answer if there was more code surrounding these lines to give context.
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are speaking of RMI calls then your guess is correct. If you are waiting for a return value, then I think it will block until it gets the value back, but if you aren't getting anything back, it will only block as long as it takes to route the request out of the JVM and have it accepted by the server so that no RemoteExceptions need to be thrown locally. Then it should return to your next statement.
HTH
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!