/* * task-2-29994705.h * * Alexander Occhipinti * Student ID: 29994705 * Created: 18 Oct 2020 * Modified: 19 Oct 2020 * * The header file for task-2-29994705.c * See task-2-29994705.c for documentation * */ #ifndef _TASK2_H #define _TASK2_H #define DEFAULT_INPUT_PATH "process-data.txt" // Default file path to read the process PCBs from before simulation #define RESULT_FILE_PATH "scheduler-result.txt" // Default file path for the results after simulation #define MAX_PATH_SIZE 256 #define MAX_QUEUE_SIZE 10 #define MAX_NUM_PROCS 10 #define TIME_QUANTUM 2 #define WAIT_PER_CYCLE 1 /* Special enumerated data type for process state */ typedef enum { UNENTERED, READY, RUNNING, PAUSED, EXIT } process_state_t; /* C data structure used as process control block. * The scheduler should create one instance * per running process in the system */ typedef struct { char process_name[11]; // a string that identifies the process /* Times measured in seconds */ int entryTime; // time process entered system int serviceTime; // the total CPU time required by the process int deadline; // The deadline of the process (for analysis) int remainingTime; // remaining service time until completion int timeStarted; // the time the process entered the RUNNING state int timeFinished; // the time the process entered the EXIT state (i.e. it completed) process_state_t state; // current process state (e.g. READY) } pcb_t; #endif