'Process starvation test case on XINU

I am trying to produce a test case for demonstrating starvation by xinu's default scheduling policy.: if 2 processes are ready for execution, the one with higher priority keeps running and if processes have equal priority than round robin algo.

The rough idea is to create 2 processes with different priority. This creation puts both the process in suspended state. After this, we call the resume sys call for process 1 which puts it into readylist schedule queue which then calls reschedule sys call which executes it.

Since xinu cant run in parallel, only after proc 1 is complete, the same happens for proc 2. Thus, I cant seems to figure out how to demonstrate starvation in xinu. I know it occurs, but i have trouble thinking a way around this.



Solution 1:[1]

You can try having the first process run an infinite loop. As long as its priority is higher than the 2nd process, the 2nd wouldn't get any processing time.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Slow_5_0