fine grained locking and traversing linked lists

Giorgos Keramidas keramida at linux.gr
Fri Sep 3 14:09:30 PDT 2004


On 2004-09-03 11:57, Maksim Yevmenkin <maksim.yevmenkin at savvis.net> wrote:
>
> so, i've written a "spherical cow" that shows fine grained locking
> when traversing linked lists (see below). basically, for double linked
> list, in order to safely manipulate by object "y" one must hold three
> locks: object "y" lock, object "x = y->previous" lock and object "z =
> y->next" lock.
>
> so, the $1 million question is: am i missing something? or this will work?

See ``the dining philosophers problem'' at Google.



More information about the freebsd-current mailing list