main logo
Subject: Re: record locking
Author: Charles Yeomans
Posted: 2001/09/30 19:15:45
 
View Entire Thread
New Search


On Saturday, September 29, 2001, at 07:55 AM, Ruslan Zasukhin wrote:

> on 9/28/01 19:34, Charles Yeomans at yeomans .AT. desuetude .DO.T com wrote:
>
>> I'm trying out the following scheme for implementing record locking,
>> and
>> I'm looking for opinions (I know you've all got one...).
>>
>> The idea is to write a subclass of VBaseObject which handles the
>> details. You'd then make all of your base object classes inherit from
>> VLockableBaseObject (remembering to call VLockableBaseObject in the
>> constructor of any subclass).
>>
>>
>> Class VLockableBaseObject extends VBaseObject
>>
>>
>> Properties
>> editLock as VBoolean (private)
>> lockFlag as Semaphore (private)
>
> Hi Charles,
>
> if you want lock whole BaseObject then you can use semaphore.
> If you need lock on record you need to use VBoolean field.


The semaphore is supposed to handle the situation where two threads both
want access to the same base object. The idea, as I see it, is that
when a thread asks to lock a record, no other thread must be allowed to
ask until the first thread receives an answer. Am I wrong in thinking
that these requests need to be ordered using a semaphore?

Charles Yeomans
 
©2001 Charles Yeomans
<-- Prior Message New Search Next Message -->