1
0

Merge branch 'main' of git.kb28.ch:HEL/OS-Lab-Scheduler

This commit is contained in:
Louis Heredero 2024-10-15 13:55:19 +02:00
commit 4e527bccfe
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7

View File

@ -4,7 +4,7 @@
#define RR_QUANTUM 2
#define CNTXT_SWITCH 1
#define MAX_PROCESSES 10
int MAX_PROCESSES = 0;
enum pstate {
WAITING,
@ -598,6 +598,8 @@ struct pinfo * read_file() {
struct pinfo * process;
while (fgets(line, buf_size, file)) {
MAX_PROCESSES += 1;
pid_str = strtok(line, " ");
arrival_str = strtok(NULL, " ");
execution_str = strtok(NULL, " ");
@ -625,7 +627,10 @@ struct pinfo * read_file() {
}
free(line);
fclose(file);
printf("Maximum des processus : %d\n", MAX_PROCESSES);
return first;
}
void free_processes(struct pinfo * next) {