Bit of an idea for scheduling...
Posted: Sun Mar 11, 2007 3:14 am
I no longer work on my OS much, but what do you think of this idea..
What if an application could schedule itself? or at least a thread..
kindof like
basically what this would do is tell the OS for this thread to run in 1000ms, or 1 second, and then waits for the current time slice to be over
This way there wouldn't just be an empty wait loop for 1000ms...the OS could give away the processing time to others..
This would be especially useful in sound drivers..imagine it, you put all the sound bytes into the DMA buffer, call this with something like 750ms or something(forgot how much time normal 44k time is..), copy the next chunk of sound into DMA, and repeat...just-in-time DMA..
What if an application could schedule itself? or at least a thread..
kindof like
Code: Select all
...
{
StopAndScheduleThreadNextFor(1000);
}
This way there wouldn't just be an empty wait loop for 1000ms...the OS could give away the processing time to others..
This would be especially useful in sound drivers..imagine it, you put all the sound bytes into the DMA buffer, call this with something like 750ms or something(forgot how much time normal 44k time is..), copy the next chunk of sound into DMA, and repeat...just-in-time DMA..