mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-20 02:32:19 +00:00
75 lines
5.0 KiB
HTML
75 lines
5.0 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>Synchronization</title>
|
|
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
|
<link rel="home" href="../index.html" title="Chapter 1. Fiber">
|
|
<link rel="up" href="../index.html" title="Chapter 1. Fiber">
|
|
<link rel="prev" href="stack.html" title="Stack allocation">
|
|
<link rel="next" href="synchronization/mutex_types.html" title="Mutex Types">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table cellpadding="2" width="100%"><tr>
|
|
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
|
|
<td align="center"><a href="../../../../../index.html">Home</a></td>
|
|
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
|
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="stack.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="synchronization/mutex_types.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
|
<a name="fiber.synchronization"></a><a name="synchronization"></a><a class="link" href="synchronization.html" title="Synchronization">Synchronization</a>
|
|
</h2></div></div></div>
|
|
<div class="toc"><dl>
|
|
<dt><span class="section"><a href="synchronization/mutex_types.html">Mutex Types</a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/conditions.html">Condition Variables</a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/barriers.html">Barriers</a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/channels.html">Channels</a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/futures.html">Futures</a></span></dt>
|
|
<dd><dl>
|
|
<dt><span class="section"><a href="synchronization/futures/future.html">Future</a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/futures/promise.html">Template
|
|
<code class="computeroutput"><span class="identifier">promise</span><span class="special"><></span></code></a></span></dt>
|
|
<dt><span class="section"><a href="synchronization/futures/packaged_task.html">Template
|
|
<code class="computeroutput"><span class="identifier">packaged_task</span><span class="special"><></span></code></a></span></dt>
|
|
</dl></dd>
|
|
</dl></div>
|
|
<p>
|
|
In general, <span class="bold"><strong>Boost.Fiber</strong></span> synchronization objects
|
|
can neither be moved nor copied. A synchronization object acts as a mutually-agreed
|
|
rendezvous point between different fibers. If such an object were copied somewhere
|
|
else, the new copy would have no consumers. If such an object were <span class="emphasis"><em>moved</em></span>
|
|
somewhere else, leaving the original instance in an unspecified state, existing
|
|
consumers would behave strangely.
|
|
</p>
|
|
<p>
|
|
The fiber synchronization objects provided by this library will, by default,
|
|
safely synchronize fibers running on different threads. However, this level
|
|
of synchronization can be removed (for performance) by building the library
|
|
with <span class="bold"><strong><code class="computeroutput"><span class="identifier">BOOST_FIBERS_NO_ATOMICS</span></code></strong></span>
|
|
defined. When the library is built with that macro, you must ensure that all
|
|
the fibers referencing a particular synchronization object are running in the
|
|
same thread.
|
|
</p>
|
|
</div>
|
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
|
<td align="left"></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2013 Oliver Kowalke<p>
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
|
</p>
|
|
</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="stack.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="synchronization/mutex_types.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|