thread

所属分类:Linux/Unix编程
开发工具:C++
文件大小:38KB
下载次数:33
上传日期:2011-03-13 09:08:17
上 传 者jing20054786
说明:  概述一下原理和每个类的作用 (1): CTask 一个任务基类,作为线程的参数用 (2): CWorkThread:工作线程类,轮询检测参数是否可用,如果可用的话, 就去调用参数CTask的执 行函数Execute,如果参数不可用就等待 (3): CWorkQueue:是一个任务队列,里面装载CTask子类的对象,是一个对象的容器 (4): CWorkThreadPool:工作线程池,其中包含了工作线程组,调度线程,调度线程不停的检测 任务队列中是否有可用任务对象,如过取到一个有效的任务对象,就从工作线程组中查找出来 一个空闲的工作线程,把这个任务交给这个空闲的线程去执行,如果没有空闲线程则创建新 的工作线程并添加到工作线程组中。 (1),(2),(3),(4)组成了库的核心,可以稍加修改进行应用 其他附属类: (5):CSimpleUDP 一个简易的封装的UDP通讯类 (6):CLogHelper 一个线程安全的日志类,将日志存储到指定文件并能打印到标准输出 特点:支持windows和Linux平台
(Outline the principles and the role of each class (1): CTask a task base class, as arguments to thread (2): CWorkThread: Class of worker threads, polling detection parameters are available, if available, Go to the implementation of the function call parameters CTask Execute, if the parameter is not available to wait (3): CWorkQueue: a task queue, which loaded CTask subclass object is a container object (4): CWorkThreadPool: worker thread pool, which contains the group of worker threads, scheduling threads, thread scheduling non-stop testing Task queue is available in the task object, such as over the task of taking to a valid object, the thread from the Working Group to find out An idle worker thread, this task to the idle thread to execute, if no idle thread is to create a new The work of the thread and added to the thread group. (1), (2), (3), (4) form the core of the library, can be modified for application Other sub categories: (5): CSim)

文件列表:
线程库\examples\Makefile (176, 2007-05-24)
线程库\examples\UDPClient.cpp (960, 2007-05-31)
线程库\examples\UDPClient.h (254, 2007-05-23)
线程库\examples\UDPServer.cpp (1051, 2007-05-24)
线程库\examples\UDPServer.h (254, 2007-05-24)
线程库\include\CommHead.h (2559, 2007-05-30)
线程库\include\LibHead.h (191, 2007-05-30)
线程库\include\LogHelper.h (638, 2007-05-28)
线程库\include\SimpleUDP.h (837, 2007-05-28)
线程库\include\Task.h (360, 2007-05-30)
线程库\include\TaskQueue.h (504, 2007-05-31)
线程库\include\WorkThread.h (894, 2007-05-31)
线程库\include\WorkThreadPool.h (678, 2007-05-30)
线程库\src\LogHelper.cpp (1545, 2007-05-30)
线程库\src\Makefile (453, 2007-05-31)
线程库\src\SimpleUDP.cpp (4598, 2007-05-28)
线程库\src\Task.cpp (865, 2007-05-30)
线程库\src\TaskQueue.cpp (1196, 2007-05-31)
线程库\src\ThreadMain.cpp (1044, 2007-05-30)
线程库\src\ThreadMain.dsp (5004, 2007-05-31)
线程库\src\ThreadMain.dsw (545, 2011-02-26)
线程库\src\ThreadMain.ncb (66560, 2011-02-26)
线程库\src\ThreadMain.opt (53760, 2011-02-26)
线程库\src\ThreadMain.positions (210, 2011-02-26)
线程库\src\WorkThread.cpp (5095, 2007-05-31)
线程库\src\WorkThreadPool.cpp (5018, 2007-05-30)
线程库\说明.docx (16478, 2010-12-05)
线程库\src\Debug (0, 2011-02-26)
线程库\examples (0, 2010-12-05)
线程库\include (0, 2010-12-05)
线程库\src (0, 2011-02-26)
线程库 (0, 2011-03-13)

近期下载者

相关文件


收藏者