From owner-freebsd-current@FreeBSD.ORG Thu Mar 19 22:45:11 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 C94ED106564A for ; Thu, 19 Mar 2009 22:45:11 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outJ.internet-mail-service.net (outj.internet-mail-service.net [216.240.47.233]) by mx1.freebsd.org (Postfix) with ESMTP id AD2CB8FC15 for ; Thu, 19 Mar 2009 22:45:11 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 53C1010B2D3; Thu, 19 Mar 2009 15:45:11 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A1B982D6020; Thu, 19 Mar 2009 15:45:10 -0700 (PDT) Message-ID: <49C2CAFF.8040805@elischer.org> Date: Thu, 19 Mar 2009 15:45:19 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: barney_cordoba@yahoo.com References: <258770.46329.qm@web63908.mail.re1.yahoo.com> In-Reply-To: <258770.46329.qm@web63908.mail.re1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, 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 22:45:12 -0000 Barney Cordoba wrote: > > > > --- On Thu, 3/19/09, John Baldwin wrote: > >> From: John Baldwin >> Subject: Re: Is there a delay which yields? >> To: freebsd-current@freebsd.org, barney_cordoba@yahoo.com >> Cc: "Julian Elischer" , current@freebsd.org >> Date: Thursday, March 19, 2009, 11:23 AM >> 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). >> > > timo is in hz? So 1/1000th of a second by default? > > Also, I notice that hz is 1000 but get 2000 ints/second per > cpu. Why is it twice hz? how many cpus do you have? > > Barney > > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"