From owner-freebsd-current@FreeBSD.ORG Thu Mar 19 15:58:57 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 694401065733; Thu, 19 Mar 2009 15:58:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB6C8FC12; Thu, 19 Mar 2009 15:58:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id D0E7546B82; Thu, 19 Mar 2009 11:58:56 -0400 (EDT) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n2JFwIop016925; Thu, 19 Mar 2009 11:58:50 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org, barney_cordoba@yahoo.com Date: Thu, 19 Mar 2009 11:23:44 -0400 User-Agent: KMail/1.9.7 References: <808304.73330.qm@web63904.mail.re1.yahoo.com> In-Reply-To: <808304.73330.qm@web63904.mail.re1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903191123.45006.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 19 Mar 2009 11:58:51 -0400 (EDT) X-Virus-Scanned: ClamAV 0.94.2/9139/Thu Mar 19 10:09:58 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Julian Elischer , 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 List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 15:58:57 -0000 On Sunday 15 March 2009 2:43:18 pm Barney Cordoba wrote: > > --- 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(); Use pause(9). -- John Baldwin