Date: Mon, 18 Dec 2000 05:59:44 -0800 From: Julian Elischer <julian@elischer.org> To: Chuck Paterson <cp@bsdi.com> Cc: smp@FreeBSD.ORG Subject: Re: Netgraph locking primatives. take 1. Message-ID: <3A3E1850.671A4AE2@elischer.org> References: <200012180417.eBI4H8P17331@berserker.bsdi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Paterson wrote: > > Julian, > > I am not sure if the dead lock applies, it would apply > in the example code you showed. that code was not example code, but rather, something that called each routine , in order to make the inlines expand out to ensure correct compilation, and so that I could look at the code generated.. There wes no thought that it was USEFUL code. See the other (new) code for that... > > If two processes hold a reader lock and they both > request a write lock neither can ever be met because the other > process is never going to let go read lock because it is also > waiting on a write lock. 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 simulaniously to two different nodes.. You can copy it of course, but then you have two different messages with the same contents.. I don't think this problem applies. There are no 'upgrades' and messages are either processed or queued. A thread never waits for anything except for momentary spinwaits during structure manipulations. > This isn't even a tight timing race, as > long as they both hold the reader lock at the same time and are > eventually going to ask for the write lock before they release the > reader lock there is a dead lock. > > Chuck -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v 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?3A3E1850.671A4AE2>