I am confused, how to call lock and unlock method from gui. If client calls the record with -1 argument passed the whole database will be locked than what will happen to that client whose record is already locked while booking the seat, also how to unlock the whole database by the client side.
What will happen to other clients who own locks or are requesting locks when you want to lock the entire DB is a good question. There are lots of options. When you want to lock the entire DB, you can wait until no records are locked before grabbing all the locks. Or, you can grab all the free locks and as additional locks become free you can grab those and eventually you should get them all. Or, you can steal all locks away from clients owning locks and notify them that their locks are no longer valid. Things to think about is avoiding deadlock and fare sharing of resources (both not really required for the assignment though). As for unlocking all, how about -1 in unlock? - Mike
posted 18 years ago
Thanks Mark, Plz see my other question's and suggest me how i have to furthur continue with my assignment.I am very much confused how i can remove stale locks which other client's left unlocked.I think i have to use distributed garbage collection algorithm but i dont know how i works and how to write code for this alog. Plz if you have another suggestion, help me out. Anurag Mishra