Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2004 14:44:38 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        freebsd-smp@FreeBSD.org
Cc:        John Polstra <jdp@polstra.com>
Subject:   Re: Question about cv_signal(9) (never mind)
Message-ID:  <200406141444.38269.jhb@FreeBSD.org>
In-Reply-To: <XFMail.20040612171239.jdp@polstra.com>
References:  <XFMail.20040612171239.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 12 June 2004 08:12 pm, John Polstra wrote:
> On 12-Jun-2004 John Polstra wrote:
> > [Why does a caller to cv_signal(9) have to hold the associated mutex?]
>
> Never mind.  I understand now.  It allows the implementation to
> avoid doing any locking internally.  That seems perfectly
> reasonable, and I withdraw my question.

To be honest, it's also largely there to try to keep people from writing code 
that can lose wakeups.  The count optimization came later.  If the 
optimization of dropping the lock is more important and we think that people 
really won't make the mistake of not using locks when they should to avoid 
the lost wakeups then we could drop the count optimization and allow 
cv_signal() to not require the lock perhaps.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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