Java Multi-Threading Question:

Explain the difference between preemptive scheduling and time slicing?

Tweet Share WhatsApp

Answer:

In Preemptive scheduling, highest priority task will executes until it enters in waiting or dead states. It also executes, until a higher priority task enters.
In Time slicing, a task will execute for a fixed time slice and after that it will go in ready state.
At that time the scheduler will find the executable task, according to the priority and various other tasks.
In preemptive scheduling, the running task will be preempted by the higher priority task.
In time slicing methods, a task executes until the specified period of time. Once the execution of that task is complete then the higher priority task will be executed if available.

Download Java Multi-Threading PDF Read All 36 Java Multi-Threading Questions
Previous QuestionNext Question
Explain the difference between yielding and sleeping?What is thread synchronization?