3 Star 9 Fork 10

louie / OEasyPool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

OEasyPool

The thread pool, is so simple and easy to use. Do you have any reason to refuse?

Presentation

Here are mainly introduced about the use of task thread pool and structure.

thread pool uml

Class

  • OETask

    task base class, pool call doWork function.

    derived class: main logic function.

    virtual int doWork() = 0;

  • OETaskQueue

    The management of the task,for example: add/sub/recall status.

  • OEThreadPool

    The processing of the thread pool

Extend

task thread pool extend, we provide a good solution. inherit OETask, complete the main logic function.

for example: see TaskTest.h.

Config

Regarding the thread pool configuration, we also set aside the interface

use class OEThreadPool :: struct tagThreadPoolConfig and function init, can config thread pool.

Code has more detailed comments, but I still want to post here again, though he is very simple, but it seems very important.

/// thread config
typedef struct tagThreadPoolConfig {
	int nMaxThreadsNum;		    /// max thread number
	int nMinThreadsNum;		    /// min thread number
	double dbTaskAddThreadRate;   /// add - max thread task rate (decide when to increase)
	double dbTaskSubThreadRate;   /// sub - max thread task rate (decide when to reduce)
} ThreadPoolConfig;

before init, thread pool didn't do anything.

Other

You didn't do anything, You get it.

I just hope find the insufficient, if you get wrong anything, please tell me. thanks.

Before this, you should star to it, I believe that it can keep in touch between you and me.

If you are an overseas Chinese who can contact the server in we home, you may need this article [Go].

空文件

简介

纯C++ 11线程池 展开 收起
C++
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/Mr_ChenLuYong/oeasypool.git
git@gitee.com:Mr_ChenLuYong/oeasypool.git
Mr_ChenLuYong
oeasypool
OEasyPool
master

搜索帮助