From owner-freebsd-current@FreeBSD.ORG Thu Mar 19 22:02:50 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 507B3106566B for ; Thu, 19 Mar 2009 22:02:50 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from web63908.mail.re1.yahoo.com (web63908.mail.re1.yahoo.com [69.147.97.123]) by mx1.freebsd.org (Postfix) with SMTP id ED9CE8FC18 for ; Thu, 19 Mar 2009 22:02:49 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: (qmail 46976 invoked by uid 60001); 19 Mar 2009 22:02:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1237500169; bh=mr1gBZFTSoBKpw1nv7Twyv4GzxL3jmWPG0kBV5J56Eo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=L6vP1BICutE2MQ84K6D+XBlyw2kJ/A4xnHsPFPIUBsdLKI6v+qOfxPtug+hJJRPGL7AbX7pngSHX5joFJ29W2xaERf9mY+DdM+oGay/UqDj9woR45np8Bf/spvZC6OPERg1not9IWQuZScRb1lam80wgJXkwD0RhGsqRss5tTjw= 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=y9+gOmGzrpsK19LHri0SRYM/oxayPmCaVivwNV5zu+H0QRWJBGkyDj+x31rgy+9CujIwmZIuxCS59imZX16vjBrQgf8O0NRRYFb17agkgaQD5sBJj61RKlBSAys087WoMLN1FloG3vaU7kqpNzXuKv20H347SXlHkmf3qql6XOg=; Message-ID: <258770.46329.qm@web63908.mail.re1.yahoo.com> X-YMail-OSG: iTCFnjkVM1mGkrcIAuMZ9JXahB44AZGUp2SP3.lNDP5C6TmXwQ7S9xDA1.LIpkqchUlBPJ854CRyStvjCzLa_QltR5HERlp8Aly1kRwfmIJPTPvCt4ZdLmOM.P72x.6Lqcr_9BmcmcKvPywvfG0T5ARmorO0vuYEtycGrW7pecIeagTmAS6dV07CqTd_9y2aPMghYtwI58fSm1Isg_TzqDJsMM.kPQqj1Q-- Received: from [98.242.222.229] by web63908.mail.re1.yahoo.com via HTTP; Thu, 19 Mar 2009 15:02:49 PDT X-Mailer: YahooMailWebService/0.7.289.1 Date: Thu, 19 Mar 2009 15:02:49 -0700 (PDT) From: Barney Cordoba To: freebsd-current@freebsd.org, John Baldwin In-Reply-To: <200903191123.45006.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 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: Thu, 19 Mar 2009 22:02:50 -0000 --- 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? Barney