Java Multi-Threading Question:

Download Job Interview Questions and Answers PDF

Explain the difference between preemptive scheduling and time slicing?

Java Multi-Threading Interview Question
Java Multi-Threading Interview Question

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 Interview Questions And Answers PDF

Previous QuestionNext Question
Explain the difference between yielding and sleeping?What is thread synchronization?