小白对Linux进程调度0.11源码的解析
//linux0.11/kernel/sched.c
void schedule(void)//调度函数
{
int i,next,c;//i表示当前进程数组下标,next表示下次切换的进程,c表示当前最大的时间片大小。
struct task_struct ** p;//p是一个指向task_struct指针的指针
/* check alarm, wake up any interruptible tasks that have got a signal */
for(p = &LAST_TASK ; p > &FIRST_TASK ; --p)//从后往前遍历
if (*p) {
//如果指向的对象不为空
if ((*p)