⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thread_pool.cc

📁 这是一个模拟电信计费的程序,非常详细,运用了线程池、消息队列和socket编程等技术。
💻 CC
字号:
#include "thread_pool.h"using namespace std;thread_pool::thread_pool(int _i, int key) : total(_i) {	#ifdef __DEBUG	cout << " Create thread pool " << endl; 	#endif	//create ipc queue to send/receive messages		if((mqid = msgget(key,0))<0) 		{    	mqid = msgget(key, IPC_CREAT | IPC_EXCL | 0600);    	if (mqid < 0)    	{            ERR_REPORT();       	}    }}thread_pool::~thread_pool() { 	#ifdef __DEBUG	cout << " Thread pool canceled. " << endl;	#endif	msgctl(mqid,IPC_RMID,0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -