|
Answer» Time slicing allows a task to run for a set amount of time before returning to the pool of ready TASKS. The scheduler then determines the executable job depending on the priority and a variety of other factors. A task in a time-slicing method runs for a predetermined amount of time. If there is another task with a higher priority after that task is completed, the scheduler runs the priority task next, BASED on priority and other considerations. The advantages of time slicing in CPU Scheduling are: - CPU resources are distributed fairly. The kernel of our CPUs does not simply allocate all of our PCs' resources to a single task or service. Because the CPU is always running multiple processes that are required for it to function, our kernel manages these processes without delay.
- It prioritizes all processes equally. The CPU accomplishes this by running processes one at a time, slice by slice. A time slice is a brief period of time that is allotted to a process and executed by the CPU.
- It's simple to integrate into the system.
- After a process has run for a set amount of time, it is interrupted and another process runs for the same amount of time. To save the states of preempted processes, the context switching approach is utilised. Hence, the states of the preempted processes are not lost.
The disadvantages of time slicing in CPU Scheduling are: - The processor output will be delayed if the slicing time is short.
- It spends a lot of time switching between contexts.
- The time quantum/slice has a significant impact on process management.
- Processes do not have defined priorities.
- Priority is not given to more vital jobs.
- It's challenging to come up with an adequate time quantum/slice.
|