-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.h
More file actions
35 lines (29 loc) · 809 Bytes
/
Process.h
File metadata and controls
35 lines (29 loc) · 809 Bytes
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
//
// Created by yaelao on 5/30/23.
//
#ifndef SHELL_PROCESS_H
#define SHELL_PROCESS_H
#include "Queue.h"
enum ProcessState {
NEW, READY, WAITING, RUNNING, TERMINATED
};
typedef struct {
int pid;
enum ProcessState state;
int burst_time;
int waiting_time;
int turn_around_time;
int t_time;
int size;
} Process;
Process *make_process(int pid, int burst_time, int memory_blocks);
int compare_process(void *data1, void *data2);
void print_process(void *data);
void first_come_first_served(Queue *queue);
void shortest_job_first(Queue *queue);
int get_shortest_index(Queue *queue);
void round_robin(Queue *queue, int quantum);
Process *get_process(Queue *queue, int pid);
void free_process(Process *process);
void kill_process(Queue *queue, int pid);
#endif //SHELL_PROCESS_H