Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Sep 1997 19:22:22 -0700
From:      Julian Elischer <julian@whistle.com>
To:        "Jamil J. Weatherbee" <jamil@counterintelligence.ml.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Realtime Programming Under FreeBSD?
Message-ID:  <3416045E.446B9B3D@whistle.com>
References:  <Pine.BSF.3.96.970909114239.5264A-100000@counterintelligence.ml.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jamil J. Weatherbee wrote:
> 
> 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.
> 
> Thank You In advance.

check the pcaudio driver.
it sets the hardware interrupt speed to 16000 Hz (!)
using the routines in the kernel, you can get a function (in the kernel)
to be called at each H/W interrupt, and you can make the H/w interrupts
be a multiple of the hz value (normally 100)
the pcaudio claims all the timers, (2 timers are used to control the 
audio hardware in PCs (pitch and beep-duration)

you don't need to do that, just look at how it changes the 
timer..
1000Hz, not a real problem compared to 16000.
:)

julian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3416045E.446B9B3D>