开发者

Can anyone please let me know the usage of schedule() function in linux kernel

Can anyone please let me know t开发者_如何学JAVAhe usage of schedule() function in linux kernel.

Who will schedule this scheduler thread.?

Thanks in advance


Two mechanism are available: voluntary or hardware-based.

http://lwn.net/Articles/95334/

Arising from a recent patch, voluntary preemption has been introduced into the kernel:

http://kerneltrap.org/node/3440

This means the CPU will explicitly surrender the current job and let the scheduler take over to select the next tasks on the active tasks list. It has been found that this way of voluntary preemption improved performance over involuntary preemption (which is timer clock-based)

More info:

http://wiki.osdev.org/Context_Switching (software vs hardware context switching - similar to what we are talking here)

http://wiki.osdev.org/Scheduling_Algorithms


There is no scheduler thread in the Linux kernel. There are specific situations in which the schedule() function is called. For example:

1) When a process or kernel thread explicitly calls it in kernel mode. A process generally calls schedule() function if it needs to wait for some event to occur; like availability of data from an input-output device.

2) When a process of priority higher than the current process was waiting for some event and the event occurs.

3) When the time slice allocated to the current process expires.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜