From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 27 16:35:28 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 67F0916A41F; Wed, 27 Jul 2005 16:35:28 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8F5D43D45; Wed, 27 Jul 2005 16:35:27 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.3/8.13.3) with ESMTP id j6RGiWgW007413; Wed, 27 Jul 2005 10:44:32 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <42E7B7B5.30708@samsco.org> Date: Wed, 27 Jul 2005 10:35:01 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050615 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org Cc: Norbert Koch , "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: Wed, 27 Jul 2005 16:35:28 -0000 Daniel Eischen wrote: > 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... > ???? Can you explain why tsleep and wakeup should no longer be used? I wasn't aware that they were formally deprecated. Scott