浏览代码

实验6 第二版

x86-32
423A35C7 5 个月前
父节点
当前提交
f3c2d8b154
共有 2 个文件被更改,包括 1 次插入3 次删除
  1. +0
    -1
      labcodes_answer/lab6_result/kern/process/proc.h
  2. +1
    -2
      labcodes_answer/lab6_result/kern/schedule/default_sched.c

+ 0
- 1
labcodes_answer/lab6_result/kern/process/proc.h 查看文件

@ -64,7 +64,6 @@ struct proc_struct {
skew_heap_entry_t lab6_run_pool; // FOR LAB6 ONLY: the entry in the run pool
uint32_t lab6_stride; // FOR LAB6 ONLY: the current stride of the process
uint32_t lab6_priority; // FOR LAB6 ONLY: the priority of process, set by lab6_set_priority(uint32_t)
uint32_t lab6_ticket_start;
};
#define PF_EXITING 0x00000001 // getting shutdown

+ 1
- 2
labcodes_answer/lab6_result/kern/schedule/default_sched.c 查看文件

@ -174,7 +174,6 @@ ticket_enqueue(struct run_queue *rq, struct proc_struct *proc) {
proc->time_slice = rq->max_time_slice;
}
proc->rq = rq;
proc->lab6_ticket_start = rq->lab6_total_num + 1;
rq->proc_num ++;
rq->lab6_total_num += proc->lab6_priority + 1;
@ -218,7 +217,7 @@ ticket_dequeue(struct run_queue *rq, struct proc_struct *proc) {
list_del_init(&(proc->run_link));
#endif
rq->proc_num --;
rq->lab6_total_num -= proc->lab6_priority;
rq->lab6_total_num -= proc->lab6_priority + 1;
}
static void

正在加载...
取消
保存