毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> linux >> 正文

linux内核进程调度算法详解

更新时间:2014-10-21:  来源:毕业论文

在BACH的一书《UNIX操作系统设计》里面看到如下关于linux进程调度的算法,不理解,希望高手解惑,谢谢!
algorithm:schedule_process
{
    while(no process picked to execute)
     {
          for(every process on runqueue)
            picked highest priority process that is load in memory;
          if(no process eligible to excute)
            idle the machine ;
            /*interrupt takes machine out of idle state*/
     }
     remove chosen process from run queue ;
     switch context to that of chosen process ,resum its execution ;
}
Operating system process scheduler implementations

The algorithm used may be as simple as round-robin in which each process is given equal time (for instance 1 ms, usually between 1 ms and 100 ms) in a cycling list. So, process A executes for 1 ms, then process B, then process C, then back to process A.

More advanced algorithms take into account process priority, or the importance of the process. This allows some processes to use more time than other processes. The kernel always uses whatever resources it needs to ensure proper functioning of the system, and so can be said to have infinite priority. In SMP(symmetric multiprocessing) systems, processor affinity is considered to increase overall system performance, even if it may cause a process itself to run more slowly. This generally improves performance by reducing cache thrashing.
这是一段伪码,翻译过来就好懂喽
大致意思就是
遍历运行队列从中挑选“合适”的进程,一般按照优先级和时间片选择进程,如果存在满足条件的进程,则退出查询循环,从运行队列上摘此进程(其实就是删除链表结点),然后切换进程上下文。如果不存在满足条件的进程(即运行队列空),则执行idle(就是空循环)

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。