From 4f7893b70e33bda4dda8c778e5676cbddb297845 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 8 Oct 2024 15:24:55 +0200 Subject: [PATCH] added remaining time member to pinfo --- simulator.c | 3 +++ 1 file changed, 3 insertions(+) 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;