Re: Use of yield() in the kernel

Duncan Sands (baldrick@wanadoo.fr)
Fri, 25 Oct 2002 16:15:24 +0200


This is my current understanding of some different ways to schedule:

(1) Yield to a higher priority task (if there is one):
cond_resched();

(2) Yield to the next task (if there is another one):
set_current_state(TASK_RUNNING);
schedule();

(3) Yield to all tasks:
yield();

Notes:
(1) Also yields if the current task's time quantum has expired.
(3) Only guaranteed to yield to all tasks on the active list.

Corrections?

Duncan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/