Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rmi server and deadlock  RSS feed

Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm wondering how rmi server arrange the client calls in the case there's only one remote object to service all the clients. under some circumstances i think it's somewhat awkward.
Here is my understanding:
Since there's only one remote object, there's only one thread(rmi server does not spawn a new thread for each client's look up method, it just simply pass the reference. is it right?) for all the clients connection.
When the clients make concurrent invocations, how the server arrange that? I think since no priority issues here, the server just service the first call and make the call atomic(another guesswork, if i'm wrong pls correct me), the server does not guarantee that 2 calls contained in 1 client method could not be
interrupted by other clients' call. During one call, all other calls must wait in queque for it (the present invocation) to finish.
What if the present call is a blockable method? and what if when the cause of the block is that the present call is requiring the resource occupied by some waiting client? the present client hold the thread and require the resource held by other client but cant get the server thread to release it, isn't it a deadlock?
let's take FBN project for example and suppose there's a method bookSeat() at the client
public void bookSeat(int i) throws RemoteException
suppose client_1 locked the record_n and losed the server thread control, at the time, client_2 get the thread and wish to lock the record_n, deadlock formed.
My solution for this is to put such method in the Remote object, let server guarantee the bookSeat() method be a atomic method. Is my solution feasible?
All my reasoning is largely based on my guesswork, i wish some guru could clear it up and give me a verification.
And could someone give some good website and articles concerning this?
Thanks in advance
- James
[ March 11, 2002: Message edited by: James Du ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!