summaryrefslogtreecommitdiff
path: root/task-2-29994705.h
diff options
context:
space:
mode:
Diffstat (limited to 'task-2-29994705.h')
-rw-r--r--task-2-29994705.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/task-2-29994705.h b/task-2-29994705.h
new file mode 100644
index 0000000..0675a74
--- /dev/null
+++ b/task-2-29994705.h
@@ -0,0 +1,52 @@
+/*
+ * task-1-29994705.h
+ *
+ * Alexander Occhipinti
+ * Student ID: 29994705
+ * Created: 15 Oct 2020
+ * Modified: 15 Oct 2020
+ *
+ * The header file for task-1-29994705.c
+ * See task-1-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 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 \ No newline at end of file