码蚁0817班级,AI项目,脸谱,双团队架构,赛马机制
hjz
2024-12-04 06095ace67ceeeb1a53faea3565bccdee5fd31b2
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
#include <iostream>
#include "ServerSocket.h"
#include "ThreadPool.hpp"
using namespace std;
 
#define DEFAULT_THREAD_NUM 3
#define MAX_THREAD_NUM 6
#define TIME_OUT 500
mutex Task::m_mutex;
 
int main() {
    ServerSocket server1;
    string cmd;
    while (cin>>cmd)
    {
        if (cmd == "quit") {
            break;
        }
    }
 
    /*ThreadPool<Task, DEFAULT_THREAD_NUM, MAX_THREAD_NUM> threadPool_(TIME_OUT);
    Task task1("name_1");
    Task task2("name_2");
    Task task3("name_3");
    Task task4("name_4");
 
    task4.m_priority = 4;
    task3.m_priority = 8;
    task2.m_priority = 2;
    task1.m_priority = 5;
 
    threadPool_.Push(task1);
    threadPool_.Push(task2);
    threadPool_.Push(task3);
    threadPool_.Push(task4);*/
 
    system("pause");
    return 0;
}