Giter Site home page Giter Site logo

oeasypool's Introduction

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].

oeasypool's People

Contributors

chenluyong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.