Difference between preemptive scheduling and time slicing

What is the difference between preemptive scheduling and time slicing?

Preemptive scheduling : The task with highest priority will be executed until it enters the wait or dead state.

Time slicing : A task is executed for a specific and predefined slice of time and later reenters the ready tasks pool. It is the task of the scheduler to determine the task to execute next, depending on the priority and various other factors.

What is the difference between preemptive scheduling and time slicing?

If a certain task is running and the scheduling method used is preemptive, and then if there is another task that has a higher priority than the executing task, then the executing task is preempted by the higher priority task.

In time slicing methods, a task executes for a predefined slice of time.
After the execution of that task, if there is another task with a higher priority, the scheduler executes the priority task the next depending on priority and other factors.
What is synchronization and why is it important?
Threads communicate by sharing access to fields and the objects......
How are Observer and Observable used?
The observable class represents an observable object.....
What is ResultSetMetaData?
ResultSetMetaData is an object that gets information about the types and properties of the columns in a ResultSet object.....
Post your comment