문제

What process will be pointed by "current" pointer in linux kernel, when CPU load is 0% and there isn't any ready-to-run process?

Consider situation without any power-saving. What is the name of this process? I think task with PID 0 will be running and code will be

rep nop

or

HLT
도움이 되었습니까?

해결책

Current will be pid 0, process swapper or the last process, which called blocking syscall?

http://oreilly.com/catalog/linuxkernel/chapter/ch10.html

Notice that if the runqueue list is empty (no runnable process exists except for swapper), the cycle is not entered and next points to init_task. Moreover, if all processes in the runqueue list have a priority lesser than or equal to the priority of prev, no process switch will take place and the old process will continue to be executed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top