Hi all,
I am preparing the B&S project, and encountering the understanding of locking, as the requirement specified that:
If just let the current
thread keep waiting until the target record is released, it may be blocked very long time as the user holding the target record probably leaves for a day and then be back to continue record updating (what the one to do is so simply just to press the confirm button).
So I prefer to add a timestamp to the record reservation entry in which there are record no, owner Id (cookie), timestamp. If a (logical) locked record is pending more than 2 mins (time out), another thread to acquire the record will grant the right to lock it. This design can also serve the issue of client crashes.
But the requirement said that SHOULD cause the current thread to give up the CPU...., now my question is can I use the time out approach or not ?
Thanks
[ May 19, 2007: Message edited by: Barry Gaunt ]