I’m trying to implement “three level scheduling” with using threads. In short, I want to make a simulation of three level scheduling. Programming language does not matter, any suggestions are welcomed.
I’m trying to implement three level scheduling with using threads. In short, I want
Share
Inside the kernel – any thread or process – is interrupted by a typical timer input or interruption during I/O call. This brings transfer of control back to kernel’s scheduler.
Switching thread is done by scheduler which decides which thread is next runable.
Now, if you want to simulate almost this – you need to make thread do some finite tasks and hook themselves up waiting against some semaphores/mutex. There is some kind of master thread that keeps these mutex/semaphores under control. The master thread somehow runs the desired algorithm to decide which thread should be granted access.
The only real difference is that since your master thread itself is in user space not inside kernel – so it cannot really overrule and/or preempt the running threads. It can only control the simulation of how effectively the task allocation can done efficiently (between well behaved threads).
This is a very basic first step on how to think about the problem. Please add more details to work about the subject. Amend your question to evolve your answer.