Hi,
Consider 3 processes (p1, p2 and p3) Consider that the process p1 has 2 threads ( t1, t2) and lets assume that t1 takes 15 ms and t2 takes 10 ms. If the timeslice allocated for every process by RR(round-robin) is 5 ms. In the above scenario, how will the threads get scheduled ?
That is, will it follow any of the below sequence of execution ?
1) t1,t2,p2,p3,t1,t2,p2,p3 (t1 and t2 are executed first in the place of p1 and followed by the execution of p2,p3) Sharing the timeslice of 5ms allocated to p1 among the threads t1 and t2 (like, 2.5ms for t1 and 2.5ms for t2). Looks good, but is it possible to run t2 ahead of t1 here ?2) t1,p2,p3,t2,p2,p3,t1,p2,p3 (t1 is executed during the first cycle of RR and t2 is executed in the consecutive cycle of RR and so on..) I think, this causes delay in the execution of t2 .
3) t1,p2,p3,t1,p2,p3,t1,p2,p3,t2,p2,p3,t2,p2,p3 (t1 is executed in first cycle of RR and in the consecutive cycles also , until the t1 is finished. And after finishing t1, it moves to execute the t2) I think, this method will not be followed as it would lead to starvation of thread t2. So, normally, this should not be used.Further, with reference to point no.1 stated above, Is it possible to split-up/allocate 3ms for t1 and 2ms for t2 ? Any links that talk in detail about these scheme/technique ?
I use Redhat 9.0 (linux). Is there any link that explains about the scheduling between the threads in a process with clear illustrations for various scenarios?
Thx in advans, Karthik Balaguru