Pype.Clicker wrote:
as there are not so much queues (usually barely a dozen of them), i'm unsure a bitmap of non-empty queues will really improve anything ...
A thing i should check is that 'O(1)' scheduler in linux ... If anyone has hints on this ...
Well from what I know it basically runs this way:
There is a FIFO queue of process ids that are ready to run (I'll call it the "runnable" queue), and a FIFO queue of process ids that have been run and aren't blocking (I'll call it the "has run" queue).
The scheduler just takes the top process from the "runnable" queue, runs it and adds it to the bottom of the "has run" queue. Once the "runnable" queue is empty the scheduler switches the queues and continues on. So the whole process is O(1) since there are no searches required.
There's also an awful lot of pre-emptive stuff for user-focussed applications which seriously complicate matters because they can manipulate the scheduler queues in a none FIFO way.
The big point I see is that priority levels indicate relative processor time dedicated to the process, they aren't any indication of how often the process will run. All the time-dependent responsiveness details are handled outside of the part of the scheduler that does task switching. E.g. When you click on a button the button's parent process id is moved into the "runnable" queue as the next process to run.
Note: That's just what I've been able to gather from looking around the net since the O(1) scheduler started being used. I haven't had a chance to see the source ccode yet.