From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 27 15:36:04 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 28C8616A41F for ; Wed, 27 Jul 2005 15:36:04 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C39CF43D62 for ; Wed, 27 Jul 2005 15:36:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.4/8.13.4/NETPLEX) with ESMTP id j6RFZwmR009580; Wed, 27 Jul 2005 11:35:58 -0400 (EDT) Date: Wed, 27 Jul 2005 11:35:58 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Norbert Koch In-Reply-To: <001801c59277$432fd960$4801a8c0@ws-ew-3.W2KDEMIG> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: "Freebsd-Hackers@Freebsd. Org" , Scott Long Subject: RE: await & asleep X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 15:36:04 -0000 On Wed, 27 Jul 2005, Norbert Koch wrote: > > > The functions await() and asleep() in kern_synch.c > > > are marked as EXPERIMENTAL/UNTESTED. > > > Is this comment still valid? Does anyone have used > > > those functions successfully? Should I better not > > > use them in my device driver code for RELENG_4? > > > How do I correctly cancel a request (as I should do > > > according to the man page): "asleep (NULL, 0, NULL, 0)"? > > > > The await family was removed in 5.x and beyond, so trying to > > use them in 4.x will make your driver very unportable. There > > are better ways than await to handle delayed events. Well, there's tsleep() and wakeup() for FreeBSD < 5.0. Other than that, what else can you do? These functions are deprecated in 5.x and 6.x in favor of condvar(9) and mutex(9), so you should really use those instead of tsleep() and wakeup(). It seems the kernel in -current is still using tsleep() and wakeup() in some places. I thought we got rid of all these... -- DE