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 RR_QUANTUM 2
|
||||||
#define CNTXT_SWITCH 1
|
#define CNTXT_SWITCH 1
|
||||||
#define MAX_PROCESSES 10
|
int MAX_PROCESSES = 0;
|
||||||
|
|
||||||
enum pstate {
|
enum pstate {
|
||||||
WAITING,
|
WAITING,
|
||||||
@ -598,6 +598,8 @@ struct pinfo * read_file() {
|
|||||||
struct pinfo * process;
|
struct pinfo * process;
|
||||||
|
|
||||||
while (fgets(line, buf_size, file)) {
|
while (fgets(line, buf_size, file)) {
|
||||||
|
|
||||||
|
MAX_PROCESSES += 1;
|
||||||
pid_str = strtok(line, " ");
|
pid_str = strtok(line, " ");
|
||||||
arrival_str = strtok(NULL, " ");
|
arrival_str = strtok(NULL, " ");
|
||||||
execution_str = strtok(NULL, " ");
|
execution_str = strtok(NULL, " ");
|
||||||
@ -625,7 +627,10 @@ struct pinfo * read_file() {
|
|||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
|
printf("Maximum des processus : %d\n", MAX_PROCESSES);
|
||||||
return first;
|
return first;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_processes(struct pinfo * next) {
|
void free_processes(struct pinfo * next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user