Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Oct 2004 23:14:34 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        ssouhlal@FreeBSD.org
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: [RFC] sysctl locking
Message-ID:  <200410150614.i9F6EYwQ080109@gw.catspoiler.org>
In-Reply-To: <1C45EA64-1D5B-11D9-A525-000A95C4D7BC@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 13 Oct, Suleiman Souhlal wrote:

>> What happens if:
>> 	thread A owns an oid
>>
>> 	thread B, which wants to delete the oid, goes to sleep to wait
>> 	for the oid
>>
>> 	thread C wants the oid and goes to sleep
>>
>> 	thread A releases the oid and wakes up thread B
>>
>> 	thread B deletes the oid
>>
>> 	thread C does ???
> 
> I didn't think of this possibility. I guess I'll have to rethink the 
> whole thing, whenever I find some time.

Have thread B mark the oid as deleted and disconnect it from the tree.
When any subsequent waiting threads gain ownership, have them return
ENOENT if they see the deleted flag instead of calling the handler.
Free the oid when the last waiting thread gives up ownership.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410150614.i9F6EYwQ080109>