Merge branch 'main' of git.kb28.ch:HEL/OS-Lab-Scheduler
This commit is contained in:
commit
4e527bccfe
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user