-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPUModel.h
More file actions
49 lines (44 loc) · 841 Bytes
/
CPUModel.h
File metadata and controls
49 lines (44 loc) · 841 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef PARALLEL2_H
#define PARALLEL2_H
#include <QVector>
#include <QRandomGenerator>
#include <QThread>
#include <QtConcurrent>
#include <QFuture>
#include <iostream>
//Variant 1
class CPUProcess{
public:
CPUProcess();
void execute();
private:
quint32 processTimer;
};
class CPUQueue{
public:
CPUQueue();
void setMyLimit(quint16 limit);
bool createProcess();
quint32 getProcessAmount();
void runNKillFirst();
private:
QVector<CPUProcess> processes;
quint16 myLimit;
};
class CPU{
public:
CPU();
void exec();
void processCreator();
QString summary();
private:
bool isExecuted;
QVector<CPUQueue> threads;
quint16 threadLimit;
quint16 thr2Exec;
quint16 execLimit;
quint32 thr1Destroed;
quint32 thr1Created;
quint32 thr2max;
};
#endif // PARALLEL2_H