-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructures.h
41 lines (33 loc) · 1010 Bytes
/
structures.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef CS143B_STRUCTURES_H
#define CS143B_STRUCTURES_H
typedef struct ReadyList{
struct ProcessNode * priorities[3];
} ReadyList;
typedef struct ResourceList{
struct RCB * resources[4];
} ResourceList;
typedef struct ProcessNode {
struct PCB * process;
struct ProcessNode * next;
} ProcessNode;
typedef struct ResourceNode {
struct RCB * resource;
struct ResourceNode * next;
} ResourceNode;
typedef struct PCB {
char * pid; // Process Name
int state; // State
int priority; // Priority
int requested; // Resource Amount Requested
ResourceNode * resources; // Linked List of Resources
struct PCB * parent; // Parent
ProcessNode * child; // Linked List of Children
ProcessNode * list; // Back-pointer to readylist or waitlist
} PCB;
typedef struct RCB {
char * rid;
int size;
int inventory;
ProcessNode * waitinglist;
} RCB;
#endif //CS143B_STRUCTURES_H