From owner-freebsd-current@FreeBSD.ORG Sun Mar 15 18:43:19 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8F85106566C for ; Sun, 15 Mar 2009 18:43:19 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from web63904.mail.re1.yahoo.com (web63904.mail.re1.yahoo.com [69.147.97.119]) by mx1.freebsd.org (Postfix) with SMTP id 807208FC20 for ; Sun, 15 Mar 2009 18:43:19 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: (qmail 73745 invoked by uid 60001); 15 Mar 2009 18:43:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1237142598; bh=kb/nt3lqmaENBFVLOEuEW0tUvSgN0OGXsP39e2m4zf8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=fNdpog1lDRj+M89Whm6ukwnj534d7HPBRlIuaHsfPPiUij7Ysdskr3LXjF2Jiwf9u5f2mlBFTGamS+XdI7cYqVLXZk5QoKHUDQ2c7tcDtPNmcmvdFMbIyAgCMBL1xGV+KJwebLRmJxFol+Zy7DNtDGMzHQI3T0kReLZ2tbV/TJQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=gyi++2S0KboMs9HEM6C+sF61h+3NiG87SBwr6gwu6mXdYoITnH9a5fNItbDx7CP/i/x5e6YrcqRLzmLVEBdUBz+yM4T5q/WqmNmQAuOMV5harZTwZS8+4gyYoBPdLJTYC11ju3W0m+fIXTkThafgQD2ZLIcD4c0UThu4QUbxgRI=; Message-ID: <808304.73330.qm@web63904.mail.re1.yahoo.com> X-YMail-OSG: l.LdmQgVM1mC3Esw1mUiRRd0x1vCJV2lL8a4XvWZWmsDD_Fa_Fyoh1dw7gqQHDVwxok45PjbMDsGljmr2I173iBG75ttKlljWGcMvsImxmSwHzSdhH7.eT74WuDubZ_BJeBlS.uY7wzlV44cpfPXmwqAGUvF4J61r14NfRDI9jJGHSrE2JXdkow7lzRnY_nW Received: from [98.242.222.229] by web63904.mail.re1.yahoo.com via HTTP; Sun, 15 Mar 2009 11:43:18 PDT X-Mailer: YahooMailWebService/0.7.289.1 Date: Sun, 15 Mar 2009 11:43:18 -0700 (PDT) From: Barney Cordoba To: Julian Elischer In-Reply-To: <49BD37FB.7060101@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: current@freebsd.org Subject: Re: Is there a delay which yields? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: barney_cordoba@yahoo.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2009 18:43:20 -0000 --- On Sun, 3/15/09, Julian Elischer wrote: > From: Julian Elischer > Subject: Re: Is there a delay which yields? > To: barney_cordoba@yahoo.com > Cc: current@freebsd.org > Date: Sunday, March 15, 2009, 1:16 PM > Barney Cordoba wrote: > > I'd expect DELAY to yield till timeout but a task > with a delay loop just > > runs to 100% usage. Is there a function which can > yield exectution for > > a set amount of time (without having to use a timer)? > > DELAY is designe for use early in the boot when thre are no > timers. > it is only occasionally used for cases during normal > operation. > > how would a thread know how long it has been away if no > timer is used? I guess I mean a sleep. Also, this is a kernel driver. I have a device which requires a toggle with a 10ms delay between pulses. I hate to tie up the cpu for 10ms with a delay. Sort of like the following: write_pulse(); delay(10000); write_pulse(); Barney