Parcourir la source

实验6 第二版

x86-32
423A35C7 il y a 5 mois
Parent
révision
f3c2d8b154
2 fichiers modifiés avec 1 ajouts et 3 suppressions
  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 Voir le fichier

@ -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 Voir le fichier

@ -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

Chargement…
Annuler
Enregistrer