Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2000 12:54:02 -0000
From:      "James Mansion" <james@westongold.com>
To:        "Julian Elischer" <julian@elischer.org>, "Chuck Paterson" <cp@bsdi.com>
Cc:        <smp@FreeBSD.ORG>
Subject:   RE: Netgraph locking primatives. take 1.
Message-ID:  <ODEEJFFGLIBKGLFBJHOIEEBHDCAA.james@westongold.com>
In-Reply-To: <3A3E1850.671A4AE2@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>Threads never hold more than one of these locks.
>either you are running in node X in which case you hold a reader
>lock on Node X or you are running in node Y in which you hold a 
>reader lock on node Y. the same message cannot be delivered 

How so?

Do you never MOVE from X to Y?

If you do so by:
 - establish location of Y
 - release X
 - acquire Y

Then there is a race with the destruction of Y.  And if you
go:
 - establish location of Y
 - acquire Y
 - release Y
then you can deadlock.

Is it really worh acquiring locks at a node level - surely
if most of the time you are not changing the node structure,
then it would be easier and (if you touch multiple nodes)
much cheaper to acquire read/write on the whole structure?

James



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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