From owner-cvs-all Thu Jul 5 15:28:46 2001 Delivered-To: cvs-all@freebsd.org Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by hub.freebsd.org (Postfix) with ESMTP id A321A37B40A; Thu, 5 Jul 2001 15:28:42 -0700 (PDT) (envelope-from gibbs@scsiguy.com) Received: from scsiguy.com (localhost [127.0.0.1]) by aslan.scsiguy.com (8.11.2/8.9.3) with ESMTP id f65MSeU64741; Thu, 5 Jul 2001 16:28:40 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Message-Id: <200107052228.f65MSeU64741@aslan.scsiguy.com> To: John Baldwin Cc: Alfred Perlstein , Jake Burkholder , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Matt Dillon , Matthew Jacob , Doug Rabson Subject: Re: cvs commit: src/sys/sys systm.h condvar.h src/sys/kern kern_ In-Reply-To: Your message of "Thu, 05 Jul 2001 12:37:47 PDT." Date: Thu, 05 Jul 2001 16:28:40 -0600 From: "Justin T. Gibbs" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >It happens with SMP, too, not just preemption. The calls are an optimization >to avoid problems with releasing the lock after the wakeup. The contention >can be avoided if we release the lock before calling wakeup(), but doing that >leaves a window open for another CPU to alter the data that the lock protects >possibly invalidating the wakeup that then gets sent. This window exists anyway. The locked mutex it not passed to the woken up thread, so there will always be a race between the woken up thread acquiring the mutex and some other thread on some other CPU acquiring it first and making the wakeup invalid. -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message