瀏覽代碼

实验6 第二版

x86-32
423A35C7 3 月之前
父節點
當前提交
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

Loading…
取消
儲存