From owner-freebsd-threads@FreeBSD.ORG Fri Feb 27 12:35:51 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 C82DB16A4CE; Fri, 27 Feb 2004 12:35:51 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6980743D2F; Fri, 27 Feb 2004 12:35:51 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i1RKZoDF009601; Fri, 27 Feb 2004 15:35:50 -0500 (EST) Date: Fri, 27 Feb 2004 15:35:50 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: John Baldwin In-Reply-To: <200402271455.38197.jhb@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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:35:51 -0000 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. > Secondly, cv's don't really handle > td_intrval very well at all. It has one hard-coded override for the P_EXIT > case but that's it. I'm not sure about this. Julian or David would know better. -- Dan Eischen