2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-19 04:02:17 +00:00
Ivan A. Melnikov 819c2d6423 Fix ABI detection for empty 'os.platform'
`in` operator in bjam always returns true if its first
argument has no elements[1]. This means that if `os.platform`
is empty (not detected), the construction introduced
in commit d039c8e4da sets
ABI to `aapcs` on all platforms where `os.platform` is
empty, including, e.g. riscv64, and breaks build there.

This commit refactors the condition to use '=' operator,
to make sure that when `os.platform` is empty we get
the default ABI value, and thus fixes build on riscv64.

[1] https://www.boost.org/doc/libs/1_83_0/tools/build/doc/html/index.html#jam.language.flow_of_control

Fixes: d039c8e4da
2023-08-17 14:15:03 +04:00
2021-01-21 19:37:06 +00:00
2022-06-26 09:51:30 +08:00
2022-09-29 22:58:22 -07:00
2020-12-15 21:54:35 -05:00
2020-06-26 17:50:15 +02:00
2021-01-21 19:37:06 +00:00
2013-12-03 18:57:14 +01:00
2017-12-20 15:33:01 +01:00
2019-02-02 12:59:32 +01:00

boost.context

boost.context is a foundational library that provides a sort of cooperative multitasking on a single thread. By providing an abstraction of the current execution state in the current thread, including the stack (with local variables) and stack pointer, all registers and CPU flags, and the instruction pointer, a execution_context instance represents a specific point in the application's execution path. This is useful for building higher-level abstractions, like coroutines, cooperative threads (userland threads) or an equivalent to C# keyword yield in C++.

A fiber provides the means to suspend the current execution path and to transfer execution control, thereby permitting another fiber to run on the current thread. This state full transfer mechanism enables a fiber to suspend execution from within nested functions and, later, to resume from where it was suspended. While the execution path represented by a fiber only runs on a single thread, it can be migrated to another thread at any given time.

A context switch between threads requires system calls (involving the OS kernel), which can cost more than thousand CPU cycles on x86 CPUs. By contrast, transferring control among fibers requires only fewer than hundred CPU cycles because it does not involve system calls as it is done within a single thread.

boost.context requires C++11!

Description
Mirrored via gitea-mirror
Readme 9 MiB
Languages
Assembly 63.9%
C++ 34.5%
CMake 1.4%
Shell 0.1%