From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 28 04:11:16 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C3E016A41F; Thu, 28 Jul 2005 04:11:16 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.village.org (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A85943D48; Thu, 28 Jul 2005 04:11:16 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.3) with ESMTP id j6S497Na031990; Wed, 27 Jul 2005 22:09:12 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 27 Jul 2005 22:10:09 -0600 (MDT) Message-Id: <20050727.221009.70219624.imp@bsdimp.com> To: scottl@samsco.org From: "M. Warner Losh" In-Reply-To: <42E7BD9F.6060401@samsco.org> References: <42E7BD9F.6060401@samsco.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: deischen@freebsd.org, NKoch@demig.de, freebsd-hackers@freebsd.org Subject: Re: await & asleep X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2005 04:11:16 -0000 In message: <42E7BD9F.6060401@samsco.org> Scott Long writes: : > and the priority argument of tsleep() doesn't have any meaning : > any longer, right? : > : : I thought it did, but John can give the definitive answer. Priority is still useful. It is the same priority that msleep uses. tsleep is completely equivalent to msleep with a null mtx parameter. The priority field is indeed used: /* * Adjust this thread's priority. */ mtx_lock_spin(&sched_lock); sched_prio(td, priority & PRIMASK); mtx_unlock_spin(&sched_lock); msleep is a different primitive that cv_wait and friends. cv_wait enforces good mutex practices and generally should be used... Warner