如何更改MINIX操作系统以支持IO绑定进程而不是CPU绑定进程?

时间:2013-10-24 07:36:19

标签: c operating-system minix round-robin

调度程序当前使用循环来安排。 我可以访问每个进程的用户时间和系统时间。

用户时间

rdy_head [USER_Q] - GT; user_time

系统时间头

rdy_head [USER_Q] - GT; user_time

我需要支持IO绑定进程,但cpu绑定进程不能完全饿死。

有什么想法吗?

/*===========================================================================*
 *              sched                        * 
 *===========================================================================*/
PRIVATE void sched()
{
/* The current process has run too long.  If another low priority (user)
 * process is runnable, put the current process on the end of the user queue,
 * possibly promoting another user to head of the queue.
 */

  if (rdy_head[USER_Q] == NIL_PROC) return;

  /* One or more user processes queued. */
  rdy_tail[USER_Q]->p_nextready = rdy_head[USER_Q];
  rdy_tail[USER_Q] = rdy_head[USER_Q];
  rdy_head[USER_Q] = rdy_head[USER_Q]->p_nextready;
  rdy_tail[USER_Q]->p_nextready = NIL_PROC;

  pick_proc();

}

0 个答案:

没有答案