Sean 'Captain Napalm' Conner wrote:<snip>
I'm going to post this, it's probably full of typos and editing loops,
but It's St. Paddy's
I implemented this system on a 68008 in asm/forth in 1991 after I stole
the idea from
a paper about a scheduler implemented by SUN.. It took about 40 lines
of 68K ASM,
The tasker included hard realtime timer events and interrupts with a 10
MS resolution.
If you want me to post it, just ask. With comments, it's about 200 lines?
A quanta bid scheme will eliminate this kind of problem. Every process
bids, with
a execution urgency bid on the next quanta of CPU time. The bids for all
processes are
accumulated at each task swap and the high bidder wins the quanta.
The winning processes bid is reset to zero. If a process needs more CPU,
it can raises it's bid,
allowing for simple dynamic load scheduling. Of course, you must
compute the bid range
assuring that no processes are locked out for too long a period.
This can also solve the problem of a hiigher priority task waiting on a
lower priority task.
I don't see how, when all processes are assured execution, that
starvation is a problem
with a properly designed tasker, eg, not round robin, but priority.
Old Tech, has problems, but in a controlled environment, works great.
Jim Davis.