From owner-cvs-all@FreeBSD.ORG Tue Nov 11 22:09:20 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EE7F16A4CE; Tue, 11 Nov 2003 22:09:20 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-123-40-77.dsl.pltn13.pacbell.net [68.123.40.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48AC543FA3; Tue, 11 Nov 2003 22:09:19 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.9/8.12.9) with ESMTP id hAC67sen025606; Tue, 11 Nov 2003 22:07:54 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.9/8.12.9/Submit) id hAC67rYO025605; Tue, 11 Nov 2003 22:07:53 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Tue, 11 Nov 2003 22:07:53 -0800 From: David Schultz To: John Baldwin Message-ID: <20031112060753.GA25471@VARK.homeunix.com> Mail-Followup-To: John Baldwin , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200311112207.hABM7UAu006144@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200311112207.hABM7UAu006144@repoman.freebsd.org> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/conf files src/sys/kern kern_mutex.c kern_thread.c subr_turnstile.c subr_witness.c src/sys/sys _mutex.h filedesc.h proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 06:09:20 -0000 On Tue, Nov 11, 2003, John Baldwin wrote: > jhb 2003/11/11 14:07:30 PST > > FreeBSD src repository > > Modified files: > sys/conf files > sys/kern kern_mutex.c kern_thread.c > subr_turnstile.c subr_witness.c > sys/sys _mutex.h filedesc.h proc.h > Log: > Add an implementation of turnstiles and change the sleep mutex code to use > turnstiles to implement blocking isntead of implementing a thread queue > directly. These turnstiles are somewhat similar to those used in Solaris 7 > as described in Solaris Internals but are also different. Very nice! > + * Each time a thread is created, a turnstile is malloc'd and attached to > + * that thread. When a thread blocks on a lock, if it is the first thread > + * to block, it lends its turnstile to the lock. If the lock already has > + * a turnstile, then it gives its turnstile to the lock's turnstile's free > + * list. When a thread is woken up, it takes a thread from the free list ^^^^^^ turnstile? > + * if there are any other waiters. If it is the only thread blocked on the > + * lock, then it reclaims the turnstile associated with the lock and removes > + * it from the hash table.