overview.qbk 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. [section:overview Overview]
  8. __boost_coroutine__ provides templates for generalized subroutines which allow
  9. suspending and resuming execution at certain locations.
  10. It preserves the local state of execution and allows re-entering subroutines more
  11. than once (useful if state must be kept across function calls).
  12. Coroutines can be viewed as a language-level construct providing a special kind
  13. of control flow.
  14. In contrast to threads, which are pre-emptive, __coro__ switches are
  15. cooperative (programmer controls when a switch will happen). The kernel is not
  16. involved in the coroutine switches.
  17. The implementation uses __boost_context__ for context switching.
  18. In order to use the classes and functions described here, you can either include
  19. the specific headers specified by the descriptions of each class or function, or
  20. include the master library header:
  21. #include <boost/coroutine2/all.hpp>
  22. which includes all the other headers in turn.
  23. All functions and classes are contained in the namespace __coro_ns__.
  24. [note This library requires C++11!]
  25. [important Windows using fcontext_t: turn off global program optimization (/GL) and change /EHsc (compiler
  26. assumes that functions declared as extern "C" never throw a C++ exception) to /EHs (tells
  27. compiler assumes that functions declared as extern "C" may throw an exception).]
  28. [endsect]