同步操作将从 louie/OEasyPool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The thread pool, is so simple and easy to use. Do you have any reason to refuse?
Here are mainly introduced about the use of task thread pool and structure.
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
task thread pool extend, we provide a good solution.
inherit OETask
, complete the main logic function.
for example: see TaskTest.h
.
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.
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].
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。