Date: Tue, 5 Dec 2000 01:27:02 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: cedric@wireless-networks.com (Cedric Berger) Cc: smp@FreeBSD.ORG Subject: Re: Netgraph and SMP Message-ID: <200012050127.SAA16816@usr02.primenet.com> In-Reply-To: <3A2C23ED.14303B3C@wireless-networks.com> from "Cedric Berger" at Dec 04, 2000 03:08:29 PM
next in thread | previous in thread | raw e-mail | index | archive | help
> How is this SIX-pack lock any different than a standard reader-writer lock? Here's a good introduction to a system that uses this model for its own internal processes: http://www.cs.ndsu.nodak.edu/~tatarino/496/minibase/lockMgr/lockMgr.html The main difference is that multiple reader, single writer locks don't stop new reader locks from being asserted, so long as there is already one or more reader locks already outstanding. This means that if you want a writer lock, you can't have it until all readers are idle. This means that with a lot of readers, a writer can experience starvation deadlock. With intention locks, new reservers aren't allowed to lock until the pending writer has been satisfied. Additional reader requests get in line, so that you don't get similar starvation by prioritizing writers over readers, so if you have tree readers, a writer request, and the three readers drain, the writer is granted. Meanwhile, you get two reader requests and then another writer requests, followed by two more reader requests. You simultaneously grant the reader requests, then they drain, you grant the next writer request, it drains, you grant the next cluster of reader requests. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. 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?200012050127.SAA16816>