From owner-freebsd-threads@FreeBSD.ORG Fri Feb 27 12:42:21 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 852BE16A4CE for ; Fri, 27 Feb 2004 12:42:21 -0800 (PST) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B3D643D31 for ; Fri, 27 Feb 2004 12:42:21 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 27311 invoked from network); 27 Feb 2004 20:42:20 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 27 Feb 2004 20:42:20 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i1RKgH28058220; Fri, 27 Feb 2004 15:42:18 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Daniel Eischen Date: Fri, 27 Feb 2004 15:43:43 -0500 User-Agent: KMail/1.6 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402271543.43087.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: threads@freebsd.org Subject: Re: Proper algorithm for return values from sleep X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 20:42:21 -0000 On Friday 27 February 2004 03:35 pm, Daniel Eischen wrote: > On Fri, 27 Feb 2004, John Baldwin wrote: > > As part of my sleep queue work, I found that msleep() and the cv_wait() > > functions have differing semantics for return vales. It appears that at > > least some of the early changes KSE made to msleep() were ported to cv's > > but not later cleanups. Specifically, in msleep(), if we are awakened > > while checking for signals but we didn't find a signal, we prefer a > > timeout-related return value over a signal-related value. > > It doesn't look like kern_thread.c uses any return values from msleep. > Where else would one look? I would think that cv's would want to behave > in the same manner. Not specific to kern_thread.c, but the values msleep() itself returns to all callers. Compare the implementation of msleep() and cv_timedwait_sig() post-sleep queues to see some of the XXX comments and differing code. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org