[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] TSC , 8254, and such



Tue, 11 Jul 2000 daniel sheltraw wrote:
> Paolo
> 
> Let me see if I got oneshot mode straight. Does it go something like this:
> 
> set up one-shot mode for 8254
> 
> loop
>   get time from TSC
>   compute time until next oneshot task scheduled
>   program 8254 with this time
>   {which generates interrupt from counter 0 after count down}
> end loop
> 
> Q: What if the time computed until next task is greater than 2^16/frequency 
> (8254 hits turns over)? Who is that interval timed?

One way to do it: Set up a dummy thread  hat gets sheduled after 2^16 8254
clocks, unless there are any real threads to schedule within that time. The
dummy thread should just go back to sleep when scheduled, as it's just meant as
an excuse to run the scheduler. It could be a special case in the scheduler,
rather than a real thread.

That should keep the scheduler alive and working, even if no one bothers to
run it explicitly until the "long into the future" thread is scheduled.


David Olofson
 Programmer
 Reologica Instruments AB
 david.olofson@reologica.se

..- M u C o S --------------------------------. .- David Olofson ------.
|           A Free/Open Multimedia           | |     Audio Hacker     |
|      Plugin and Integration Standard       | |    Linux Advocate    |
`------------> http://www.linuxdj.com/mucos -' | Open Source Advocate |
..- A u d i a l i t y ------------------------. |        Singer        |
|  Rock Solid Low Latency Signal Processing  | |      Songwriter      |
`---> http://www.angelfire.com/or/audiality -' `-> david@linuxdj.com -'