Date: Mon, 25 Sep 2000 09:59:37 -0700 (PDT) From: John Polstra <jdp@polstra.com> To: arch@freebsd.org Cc: tlambert@primenet.com Subject: Re: Mutexes and semaphores (was: cvs commit: src/sys/conf files Message-ID: <200009251659.JAA02227@vashon.polstra.com> In-Reply-To: <200009250827.BAA12659@usr02.primenet.com> References: <200009250827.BAA12659@usr02.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <200009250827.BAA12659@usr02.primenet.com>, Terry Lambert <tlambert@primenet.com> wrote: > With the suggested mutex recursion (please -- use a counting > semaphore, not a mutex, if you are going to permit recursion!), Please explain why you think a counting semaphore has anything to do with recursion. To support recursion a mutual exclusion primitive has to support the concept of ownership. I.e., if you already own it you can acquire it recursively, but if somebody else owns it then you cannot. A counting semaphore does not support that concept. The count is not a recursion count at all. Search google for "counting semaphore" and you'll find any number of introductory class notes on semaphores. Or cut right to the chase and go to a typical one at http://www.erc.msstate.edu/~ioana/POWERPOINT/CS4163/slides/Threads/tsld022.htm John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009251659.JAA02227>