[ale] Driver question

Michael Hirsch mhirsch at nubridges.com
Wed Sep 4 12:26:44 EDT 2002


On Wed, 2002-09-04 at 12:19, cfowler wrote:
> I need to create a function in a driver that does a task every N
> seconds.  I can not find a simple piece of text that tells me hoe I can
> do this.
> 
> Example:
> 
> 
> doAllSums(void)
> {
> 
> 	// Do something
> }
> 
> I need doAllSums to calculate stats in my driver every 8 seconds. 
> Anyone here can help me?

When you say "driver" to you mean kernel level driver, or a user level
program that drives something?  I wouldn't think that this functionality
would be a good thing to put in a kernel driver.  I'd expect a kernel
driver to keep a running total, maybe, but not an intermittent sum.

For a user program, the easiest would be to spawn a thread (using
pthreads) that wakes up every 8 seconds, grabs a semaphore, and
calculates the sum.

--Michael


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list