Tpool:基于POSIX pthread的C++线程池实现

时间:2021-06-18 15:32:32
【文件属性】:
文件名称:Tpool:基于POSIX pthread的C++线程池实现
文件大小:101KB
文件格式:ZIP
更新时间:2021-06-18 15:32:32
C++ 池 Tpool 是基于 POSIX pthread 的 C++ 线程池实现。 它的设计考虑到了简单性。 介绍 Tpool 非常易于使用。 假设你要编写一个web服务器,并在线程池中处理传入的请求,那么你可以编写如下代码来完成这个任务: # include " FixedThreadPool.h " # include < boost> # include < tcp> // note that this is a fake header, for illustration purpose using namespace tpool ; using boost::shared_ptr; // The request handler class class DaytimeTask : public TaskBase { public:
【文件预览】:
Tpool-master
----.travis.yml(445B)
----Makefile.rules(629B)
----include()
--------CountDownLatch.h(955B)
--------EndTask.h(183B)
--------FixedThreadPool.h(10KB)
--------TaskBase.h(1007B)
--------CyclicBarrier.h(1KB)
--------Timer.h(4KB)
--------BlockingQueue.h(3KB)
--------TaskQueueBase.h(437B)
--------WorkerThread.h(1KB)
--------BoundedBlockingQueue.h(4KB)
--------ThreadLocal.h(1KB)
--------CancelableThread.h(2KB)
--------PriorityTaskQueue.h(560B)
--------ThisThread.h(594B)
--------Atomic.h(7KB)
--------LinearTaskQueue.h(445B)
--------FutureTask.h(2KB)
--------FunctorTask.h(651B)
--------Thread.h(2KB)
--------Mutex.h(2KB)
--------Likely.h(282B)
--------ConditionVariable.h(4KB)
--------FunctorFutureTask.h(762B)
----unittest()
--------testFutureTask.cpp(2KB)
--------testThreadPool.cpp(7KB)
--------testCyclicBarrier.cpp(2KB)
--------TestUtil.h(194B)
--------testBlockingQueue.cpp(6KB)
--------testAtomic.cpp(7KB)
--------testMutex.cpp(3KB)
--------testCountDownLatch.cpp(3KB)
--------testFunctorTask.cpp(1KB)
--------TestUtil.cpp(269B)
--------testThread.cpp(2KB)
--------Makefile(565B)
--------testConditionVariable.cpp(3KB)
--------testTaskBase.cpp(4KB)
--------testCancelableThread.cpp(3KB)
--------testBoundedBlockingQueue.cpp(6KB)
--------testWorkerThread.cpp(4KB)
--------testLinearTaskQueue.cpp(3KB)
--------testTimer.cpp(9KB)
--------testFunctorFutureTask.cpp(325B)
----LICENSE(1KB)
----src()
--------ConditionVariable.cpp(1KB)
--------LinearTaskQueue.cpp(316B)
--------WorkerThread.cpp(2KB)
--------TaskBase.cpp(3KB)
--------EndTask.cpp(149B)
--------Thread.cpp(913B)
--------ThisThread.cpp(648B)
--------CancelableThread.cpp(3KB)
--------Timer.cpp(6KB)
--------Mutex.cpp(1KB)
--------PriorityTaskQueue.cpp(800B)
----examples()
--------DaytimeServer.cpp(2KB)
--------GetDataChunkServer()
--------EchoServer.cpp(140B)
--------DownloadServer.cpp(2KB)
--------ssh_forward_server.py(682B)
--------SshClient.cpp(6KB)
--------daytime_client.py(775B)
--------FibonacciCalculator.cpp(990B)
--------Makefile(674B)
--------download_client.py(843B)
----.gitignore(63B)
----Makefile(906B)
----cpplint.py(131KB)
----README.md(2KB)

网友评论