Thread scheduling and priorities

        1. What is the preemptive operating system?

        2. How does Windows perform threads with priorities?

        3. What does starvation mean?

A thread with a lower priority can be stopped by a preemptive multithreaded operating system to perform a thread with a higher priority at any time. 

 For each thread is assigned a priority from 1(the lowest) to 31(the highest). Windows examines threads with the highest priority and schedules them in a round-robin fashion. If Windows detects a thread with a higher priority it suspends threads with a lower priority and schedules the thread with a high priority.

 When an operating system performs threads with higher priority only and other threads are waiting. For example a thread with a higher priority is waiting for completion a thread with a lower priority and at the same time the operating system doesn’t perform this thread because the higher priority thread is running. Such process is called starvation. On multiprocessors machines threads with different priorities perform simultaneously.