Re: On thread scheduling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kyle Moffett
Date: Sunday, September 16, 2007 - 12:16 am

On Sep 14, 2007, at 18:40:00, Heikki Orsila wrote:

Actually you probably just want to do this with an ordinary single- 
threaded program.  Just do your main() thing normally and schedule a  
signal-based timer at program start (or whenever you actually set up  
your periodic interrupt source);  the timer signal-handler will act  
as the interrupt handler.  Alternatively you could have 2 threads  
where the *only* thing the second thread does is a timed poll() loop  
on an FD where it reads commands from the main thread.  When the main  
thread wants to change the interval-between-interrupts or some other  
interrupt configuration it writes the info down the FD to the  
alternate thread which actually sets up the change.  The main program  
then continues running and periodically receives its SIGUSR1 or  
whatever from the other thread and uses that as the interrupt.

Cheers,
Kyle Moffett

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
On thread scheduling, Heikki Orsila, (Fri Sep 14, 3:40 pm)
Re: On thread scheduling, Matthias Kaehlcke, (Fri Sep 14, 10:39 pm)
Re: On thread scheduling, Ray Lee, (Sat Sep 15, 7:54 am)
Re: On thread scheduling, Kyle Moffett, (Sun Sep 16, 12:16 am)