diff --git a/simulator.c b/simulator.c index e9bc07c..e117924 100644 --- a/simulator.c +++ b/simulator.c @@ -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;