• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

build/H10-Dec-2019-932835

doc/H10-Dec-2019-6,1835,535

example/H10-Dec-2019-1,5221,105

meta/H10-Dec-2019-1615

performance/H10-Dec-2019-699536

src/H10-Dec-2019-9,2954,953

test/H10-Dec-2019-2,0721,819

README.mdH A D10-Dec-20191.4 KiB2217

README.md

1boost.context
2=============
3
4boost.context is a foundational library that provides a sort of cooperative multitasking on a single thread.
5By providing an abstraction of the current execution state in the current thread, including the stack (with
6local variables) and stack pointer, all registers and CPU flags, and the instruction pointer, a execution_context
7instance represents a specific point in the application's execution path. This is useful for building
8higher-level abstractions, like coroutines, cooperative threads (userland threads) or an equivalent to
9C# keyword yield in C++.
10
11A fiber provides the means to suspend the current execution path and to transfer execution control,
12thereby permitting another fiber to run on the current thread. This state full transfer mechanism
13enables a fiber to suspend execution from within nested functions and, later, to resume from where it
14was suspended. While the execution path represented by a fiber only runs on a single thread, it can be
15migrated to another thread at any given time.
16
17A context switch between threads requires system calls (involving the OS kernel), which can cost more than
18thousand CPU cycles on x86 CPUs. By contrast, transferring control among fibers requires only fewer than
19hundred CPU cycles because it does not involve system calls as it is done within a single thread.
20
21boost.context requires C++11!
22