]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright Oliver Kowalke 2014. | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt | |
6 | ] | |
7 | ||
8 | [section:overview Overview] | |
9 | ||
10 | __boost_coroutine__ provides templates for generalized subroutines which allow | |
11 | suspending and resuming execution at certain locations. | |
12 | It preserves the local state of execution and allows re-entering subroutines more | |
13 | than once (useful if state must be kept across function calls). | |
14 | ||
15 | Coroutines can be viewed as a language-level construct providing a special kind | |
16 | of control flow. | |
17 | ||
18 | In contrast to threads, which are pre-emptive, __coro__ switches are | |
19 | cooperative (programmer controls when a switch will happen). The kernel is not | |
20 | involved in the coroutine switches. | |
21 | ||
22 | The implementation uses __boost_context__ for context switching. | |
23 | ||
24 | In order to use the classes and functions described here, you can either include | |
25 | the specific headers specified by the descriptions of each class or function, or | |
26 | include the master library header: | |
27 | ||
28 | #include <boost/coroutine2/all.hpp> | |
29 | ||
30 | which includes all the other headers in turn. | |
31 | ||
32 | All functions and classes are contained in the namespace __coro_ns__. | |
33 | ||
34 | [note This library requires C++11!] | |
35 | ||
36 | [endsect] |