I’m reading an article on real-time kernels, and the author explains how to implement a scheduler for tasks with a linked list. He also states that this is not the best way since tasks are inserted and removed based on priority; however, he doesn’t explain what those other methods are.
What are the other methods for implementing a scheduler other than a linked list?
Take a good hard look at the Queue Data structure. If you have a queue for each priority level, then you can start at the highest priority queue, and process until the queue is empty, then step to the next priority query, until you have hit all of the priorities.
Having tasks at the same priority level in a queue, allows you to guarentee that each task gets at least one quantum of processing, before it is thrown into the tail of (possibly another) queue.
Of course for real-time processsing, you want quick response to an interrupt. Perhaps some sort of Priority Queue might be applicable.