1
0

added remaining time member to pinfo

This commit is contained in:
Louis Heredero 2024-10-08 15:24:55 +02:00
parent 35cf8505c9
commit 4f7893b70e
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7

View File

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