Interesting Locking Problem

Ned Konz ned at bike-nomad.com
Fri Mar 29 00:27:07 UTC 2002


On Thursday 28 March 2002 04:02 pm, Ross Boylan wrote:
> I have two smalltalk processes that sometimes write the same
> data. Further, each process may write recursively; in the course of
> handling one write, it will attempt other writes.  I need to permit
> the recursive writes within a process while blocking activity between
> the processes.
>
> I would appreciate advice about how best to do this.  My current
> approach has a small vulnerability, and it's not clear to me how to
> correct it.  Further, it already seems a bit elaborate.

I have handled this in the past by making a Semaphore subclass (perhaps 
called RecursiveSemaphore) that knows which process has acquired it (so it 
doesn't do a wait if it has already been acquired by the current process).

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com



More information about the Squeak-dev mailing list