I'm also working on a microkernel and currently I use a very simple round-robin queue with weak references to
all threads. Threads that don't have to wake up yet are simply skipped over and any dead threads are removed lazily. This is obviously not efficient but it works well enough for now.
I don't have any concrete plans for a new scheduler yet, but I'll likely split it in two parts: a linked chain for runnable threads only and a priority queue with the "sleep until" time as key.
theflysong wrote:
I want to execute processes called by other processes as more as possible
But on the other hand, I need to prevent other processes from starvation
You may want to look into time slice donation: every thread has a limited amount of time to run, but can choose to immediately start running another thread with the remainder of its time slice. This way you can achieve low latency (which I assume is what you're after) yet it won't affect any other threads since they get to keep their time slice.