From owner-freebsd-hackers Tue Sep 9 19:51:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA28573 for hackers-outgoing; Tue, 9 Sep 1997 19:51:14 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA28559 for ; Tue, 9 Sep 1997 19:51:00 -0700 (PDT) Received: from word.smith.net.au (lot.atrad.adelaide.edu.au [203.20.121.21]) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) with ESMTP id MAA03369 for ; Wed, 10 Sep 1997 12:20:50 +0930 (CST) Received: from word.smith.net.au (localhost.atrad.adelaide.edu.au [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id MAA00765; Wed, 10 Sep 1997 12:17:49 +1000 (EST) Message-Id: <199709100217.MAA00765@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: "Jamil J. Weatherbee" cc: freebsd-hackers@freebsd.org Subject: Re: Realtime Programming Under FreeBSD? In-reply-to: Your message of "Tue, 09 Sep 1997 11:44:10 MST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 10 Sep 1997 12:17:49 +1000 From: Mike Smith Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Can someone give a code snippet of the BEST way of running a 1000HZ for > loop under freebsd, without consuming massive amounts of cpu time. How about you tell us what you're actually trying to do? It sounds like you want to poll something at a fixed 1KHz rate, which is a) uncivilised and b) not terribly easy without fiddling. If this is what you're after, look at the 'pcaudio' driver, which fiddles one of the timers to arrange a fast regular interrupt. mike