Scheduling with respect to Operatiing systems.Same logic is applicable everywhere. Scheduling is of 2 types 1.Preemptive 2.Non-Preemptive
In Preemptive scheduling,resource once allocated to a process cannot be taken back by the OS until the process having the resource releases it In nonPreemptive scheduling, resource once allocated can be taken back by the OS when needed
Consider process P1 has Resource R1 for 10 seconds, but on 5th second suppose Process P2 having higher priority than P1 requests for Resource R1, then OS will take the resource from P1 and give it to P2,this is done in Preemptive Scheduling. In non Preemptive Scheduling, the resource can be allocated to some other process only after the 10th second.
Round robin Scheduling
In round robin a time block(t1 seconds) is selected and each process can access it for t1 seconds.
Process Resource Required Time P1 R1 5 P2 R1 5 P3 R1 5
Let time block(t1) be 2 secs
Therefore the resource is allocated in the following order P1: 0-2seconds P2: 2-4seconds P3: 4-6seconds