<HTML>
<HEAD>
<TITLE>threadpool Documentation</TITLE>
<LINK HREF="threadpool.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<DIV CLASS="qindex">
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="LEFT">
<B>threadpool</B>
</TD>
<TD ALIGN="RIGHT">
<A CLASS="qindex" HREF="../index.html">Overview</A> |
<A CLASS="qindex" HREF="../reference/annotated.html">Reference</A> |
<A CLASS="qindex" HREF="../tutorial/intro.html">Tutorial</A> |
<A CLASS="qindex" HREF="../examples/intro.html">Examples</A> |
<A CLASS="qindex" HREF="../design/intro.html">Design</A>
</TD>
</TR>
</TABLE>
</DIV>
<DIV CLASS="qindex">
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="LEFT">
<B>Reference</B>
</TD>
<TD ALIGN="RIGHT">
<A CLASS="qindex" HREF="annotated.html">Class List</A> |
<A CLASS="qindex" HREF="functions.html">Member Functions</A> |
<A CLASS="qindex" HREF="namespacemembers.html">Typedefs</A> |
<A CLASS="qindex" HREF="files.html">File List</A>
</TD>
</TR>
</TABLE>
</DIV>
<!-- Generated by Doxygen 1.4.6-NO -->
<div class="nav">
<a class="el" href="a00035.html">boost</a>::<a class="el" href="a00036.html">threadpool</a>::<a class="el" href="a00024.html">thread_pool</a></div>
<h1>boost::threadpool::thread_pool< Task, SchedulingPolicy, SizePolicy, SizePolicyController, ShutdownPolicy > Class Template Reference</h1><!-- doxytag: class="boost::threadpool::thread_pool" --><a href="a00002.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<typename Task = task_func, template< typename > class SchedulingPolicy = fifo_scheduler, template< typename > class SizePolicy = static_size, template< typename > class SizePolicyController = resize_controller, template< typename > class ShutdownPolicy = wait_for_all_tasks><br>
class boost::threadpool::thread_pool< Task, SchedulingPolicy, SizePolicy, SizePolicyController, ShutdownPolicy ></h3>
Thread pool.
<p>
Thread pools are a mechanism for asynchronous and parallel processing within the same process. The pool class provides a convenient way for dispatching asynchronous tasks as functions objects. The scheduling of these tasks can be easily controlled by using customized schedulers. A task must not throw an exception.<p>
A pool is DefaultConstructible, CopyConstructible and Assignable. It has reference semantics; all copies of the same pool are equivalent and interchangeable. All operations on a pool except assignment are strongly thread safe or sequentially consistent; that is, the behavior of concurrent calls is as if the calls have been issued sequentially in an unspecified order.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>Task</em> </td><td>A function object which implements the operator 'void operator() (void) const'. The operator () is called by the pool to execute the task. Exceptions are ignored. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SchedulingPolicy</em> </td><td>A task container which determines how tasks are scheduled. It is guaranteed that this container is accessed only by one thread at a time. The scheduler shall not throw exceptions.</td></tr>
</table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>The pool class is thread-safe.</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd>Tasks: <a class="el" href="a00036.html#c6f15485d0c9225572afc57b30f50358">task_func</a>, <a class="el" href="a00021.html">prio_task_func</a> <p>
Scheduling policies: <a class="el" href="a00016.html">fifo_scheduler</a>, <a class="el" href="a00018.html">lifo_scheduler</a>, <a class="el" href="a00020.html">prio_scheduler</a> </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a00039.html#l00073">73</a> of file <a class="el" href="a00039.html">pool.hpp</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef SchedulingPolicy<<br>
<a class="el" href="a00024.html#321da9e252f14645cd3e433305576a4b">task_type</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#4bdb3cef94393456f2b7ec0d171d6b11">scheduler_type</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef SizePolicyController<<br>
pool_core_type > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#c7e01650ffec650c0279782eacb4be80">size_controller_type</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef SizePolicy< pool_core_type > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#654dc8a75dc2ea813dc6307f8707658d">size_policy_type</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef Task </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#321da9e252f14645cd3e433305576a4b">task_type</a></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#ab990245fb601499bc768737f65b09b2">active</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#9d98ecc57fb790ad12e9c12dcead921b">clear</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#4d8cacdeef78219399343a0bea999212">empty</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#1cea841e4310d6ff8a09f3f81124f45b">pending</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#3daf5e17f6c2ba9a0ecdeb73b41478e6">schedule</a> (<a class="el" href="a00024.html#321da9e252f14645cd3e433305576a4b">task_type</a> const &task)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#f0d21c4108b9808946ed8dabbbe2687f">size</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00024.html#c7e01650ffec650c0279782eacb4be80">size_controller_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#965f249200025312bd3a3a0f8144e3a5">size_controller</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#6eba12acd49dfe14c7de44073a138aa1">thread_pool</a> (size_t initial_threads=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#f229154a61cb29bc3ce969974eca3175">wait</a> (xtime const &timestamp, size_t task_threshold=0) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00024.html#dc8ccb7588160208ea0fd1d84b58269e">wait</a> (size_t task_threshold=0) const </td></tr>
</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="4bdb3cef94393456f2b7ec0d171d6b11"></a><!-- doxytag: member="boos
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
boost 线程池源代码文档 (108个子文件)
threadpool.css 7KB
threadpool.css 7KB
threadpool.css 7KB
threadpool.css 7KB
threadpool.css 7KB
tabs.css 2KB
tabs.css 2KB
tabs.css 2KB
tabs.css 2KB
tabs.css 2KB
tab_r.gif 3KB
tab_r.gif 3KB
tab_r.gif 3KB
tab_r.gif 3KB
tab_r.gif 3KB
tab_l.gif 706B
tab_l.gif 706B
tab_l.gif 706B
tab_l.gif 706B
tab_l.gif 706B
tab_b.gif 35B
tab_b.gif 35B
tab_b.gif 35B
tab_b.gif 35B
tab_b.gif 35B
a00024.html 32KB
a00036.html 24KB
a00014.html 18KB
a00041.html 16KB
a00020.html 16KB
a00016.html 16KB
a00018.html 16KB
a00039.html 14KB
functions.html 13KB
a00023.html 12KB
a00038.html 12KB
functions_func.html 11KB
a00044.html 11KB
a00021.html 9KB
a00043.html 8KB
a00019.html 8KB
index.html 6KB
a00022.html 6KB
a00002.html 6KB
classes.html 6KB
changelog.html 6KB
a00040.html 6KB
a00042.html 6KB
intro.html 5KB
a00029.html 5KB
a00015.html 5KB
a00030.html 5KB
annotated.html 5KB
a00017.html 5KB
a00025.html 5KB
a00031.html 5KB
a00026.html 5KB
a00001.html 5KB
prioritized.html 5KB
a00032.html 5KB
a00033.html 4KB
a00034.html 4KB
a00028.html 4KB
a00003.html 4KB
a00005.html 4KB
a00004.html 4KB
functions_type.html 4KB
files.html 4KB
a00011.html 4KB
license.html 3KB
hierarchy.html 3KB
a00037.html 3KB
a00012.html 3KB
instantiation.html 3KB
namespacemembers.html 3KB
globals.html 3KB
a00013.html 3KB
a00027.html 3KB
namespacemembers_type.html 3KB
a00010.html 3KB
globals_type.html 3KB
functions_vars.html 3KB
pattern.html 3KB
a00009.html 2KB
task_adaptor.html 2KB
a00007.html 2KB
a00006.html 2KB
a00035.html 2KB
a00008.html 2KB
globals_func.html 2KB
namespaces.html 2KB
pages.html 2KB
namespacemembers_func.html 2KB
intro.html 2KB
index.html 2KB
index.html 2KB
pages.html 2KB
pages.html 2KB
index.html 2KB
index.html 2KB
共 108 条
- 1
- 2
资源评论
- dailinye332012-07-06代码是基于linux的,在windows下情况会有不同。我用boost写的
linux1262600
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功