-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathprocessmanager.h
More file actions
40 lines (31 loc) · 954 Bytes
/
Copy pathprocessmanager.h
File metadata and controls
40 lines (31 loc) · 954 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
#ifndef _MPROCESSMANAGER_H
#define _MPROCESSMANAGER_H
#include "worker.h"
#include <list>
class Processmanager
{
public:
Processmanager();
~Processmanager();
void init_num_process(int count);
void start();
void adjust_proc_num();
int (*adjust_proc_strategy)(long jobs_count,Processmanager &pm);
void set_maxprocnum(int newmaxprocnum){m_maxprocnum=newmaxprocnum;}
int get_maxprocnum(){return m_maxprocnum;}
void set_minprocnum(int newminprocnum){m_minprocnum=newminprocnum;}
int get_minprocnum(){return m_minprocnum;}
void set_jobs_count(long count){m_jobs_count=count;}
long get_jobs_count(){return m_jobs_count;}
static Worker * get_one_proc_by_status(bool status);
Worker * get_one_proc_by_type(const string &type);
int cur_procnum();
static list<Worker> m_workers;
private:
int m_maxprocnum;
int m_minprocnum;
long m_jobs_count;
static void sig_child(int sig);
static void sig_term(int sig);
};
#endif