14-02-2013, 11:43 AM
Cooperative schedulers
Cooperative schedulers.pptx (Size: 1.36 MB / Downloads: 22)
Cooperative schedulers schedule such that each ready task cooperates to let running one finish.
However there is a disadvantage of cooperative scheduler.
Cooperative scheduler is cyclic but without a predefined tslice
Assume that interrupt for service for first task occurs just at beginning of the second task.
Time-slicing scheduler
The time-slicing scheduler is simpler in design and extremely valuable in many applications.
Round robin scheduler gives appropriate time slice to let finish the task with allotted time frame.
Let there be N task from task 1 to task N.
Preemptive scheduler
Now consider a example that stream of coded messages reaching a port A.
It then decrypts the message bytes and retransmits to port B after encoding each decrypted message.
Fig shows task for the multiple process of this application.
Critical section service by preemptive scheduler
Critical section where no preemption by ISR take place.
A lock function executes at beginning of each critical section and unlock function at end of critical section.
Assume that task I is waiting for critical section resource and task j is kernel lock
Now consider context switching is having time of 1 ms.Task needs critical section resource for less than 1 ms.
So here we spin lock instead of kernel lock.
Now consider task j provide context switch resource by spin lock. At time instant T1 task I want critical section resource.
So spin lock will provide busy-wait loop for task i.