-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalg.h
51 lines (33 loc) · 1002 Bytes
/
alg.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
42
43
44
45
46
47
48
49
50
51
#ifndef ALG_H
#define ALG_H
#include "heap.h"
#include "process.h"
#include "stack.h"
#include "queue.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _Running{
process* Process;
int timeQuantum;
}Running;
typedef struct _Result{
stack* finished;
queue* list;
int totaltime;
int idle;
}Result;
Result* init_Result();
Running* init_Running(int timeq);
int RunningFinished(Running* running);
void ChangeRunning(Running* running,heap* ready);
int IsAvailProcess(heap* ready,int IsFCFS,int time);
int RunningInterrupted(Running* running,int bywhom);
void SpendTime(Running* running);
int AllFinished(Running* running,heap* heap1,heap* heap2);
void FinishProcess(Running* running,int time,stack* finished);
void FromstandbyToready(heap* standby,heap* ready,int time);
void freeall(Running* running, heap* heap1,heap* heap2);
void checkingList(Result* resutl,Running* running,int time);
int RunningPreemptive(Running* running,heap* ready,int type);
#endif