[lkml]   [2001]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Task Switching in Linux
Jaswinder Singh wrote:
> In Linux , If we assume that there are only 2 tasks A and B and both are
> equal , this is correct or not :-
> TASK A -> schedule -> switch_to -> TASK B -> schedule -> switch_to ->
> schedule -> switch_to -> TASK A.
Heck no. TASK A will be run until it either blocks or its time quantum
drops below TASK B's. It does not matter how many times it calls
schedule(), 'cept its a darn waste of time.

Now, it you call sched_yield() your chances are higher, but still no
guarantee. If you get the tasks out of SCHED_OTHER sched_yield() will
do the above (if they have the same priority).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.028 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site