added remaining time member to pinfo
This commit is contained in:
parent
35cf8505c9
commit
4f7893b70e
@ -19,6 +19,7 @@ struct pinfo {
|
||||
|
||||
int wait_time;
|
||||
int completion_time;
|
||||
int remaining_time;
|
||||
enum pstate state;
|
||||
|
||||
struct pinfo * next_pinfo;
|
||||
@ -44,6 +45,7 @@ void print_pinfo(struct pinfo * info) {
|
||||
printf(" Priority: %d\n", info->priority);
|
||||
printf(" Wait time: %d\n", info->wait_time);
|
||||
printf(" Completion time: %d\n", info->completion_time);
|
||||
printf(" Remaining time: %d\n", info->remaining_time);
|
||||
printf(" NEXT -> %p\n", info->next_pinfo);
|
||||
printf("}>\n");
|
||||
}
|
||||
@ -63,6 +65,7 @@ struct pinfo * create_process(int id, int arrival_time, int execution_time, int
|
||||
info->priority = priority;
|
||||
info->wait_time = 0;
|
||||
info->completion_time = 0;
|
||||
info->remaining_time = execution_time;
|
||||
info->state = WAITING;
|
||||
info->next_pinfo = NULL;
|
||||
return info;
|
||||
|
Loading…
Reference in New Issue
Block a user