Boost
Libraries
arrow_drop_down
Boost.Context

This Release

Oliver Kowalke
Oliver Kowalke
Author
Reimar Döffinger
Contributor - New
Andrii Batyiev
Andrii Batyiev
Contributor - New
Arnaud Le Blanc
Arnaud Le Blanc
Contributor - New
Chris Ward
Contributor - New
Liryna
Liryna
Contributor - New
Rene Rivera
Rene Rivera
Contributor
Nikita Kniazev
Nikita Kniazev
Contributor
Claudio Jeker
Claudio Jeker
Contributor

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!

All Time

Edward Diener
Edward Diener
Contributor
Peter Dimov
Peter Dimov
Contributor
Naveenaidu
Naveenaidu
Contributor
Daniel James
Daniel James
Contributor
James Cowgill
James Cowgill
Contributor
Marshall Clow
Marshall Clow
Contributor
Sergey Fedorov
Sergey Fedorov
Contributor
Michael Johns
Contributor
Antony Polukhin
Antony Polukhin
Contributor
Nick Vrvilo
Nick Vrvilo
Contributor
EGuesnet
EGuesnet
Contributor
Ben Wiederhake
Ben Wiederhake
Contributor
Eric Astor
Eric Astor
Contributor
Steven Watanabe
Steven Watanabe
Contributor
sdarwin
sdarwin
Contributor
dixyes
dixyes
Contributor
Jiaxun Yang
Jiaxun Yang
Contributor
David CARLIER
David CARLIER
Contributor
leha-bot
leha-bot
Contributor
PeterYang12
PeterYang12
Contributor
ltrk2
ltrk2
Contributor
Niels Dossche
Niels Dossche
Contributor
Timo Sandmann
Timo Sandmann
Contributor
Torkel Bjørnson-Langen
Torkel Bjørnson-Langen
Contributor
Ivan A. Melnikov
Ivan A. Melnikov
Contributor
YunQiang Su
YunQiang Su
Contributor
Andreas Schwab
Andreas Schwab
Contributor
Damian Jarek
Damian Jarek
Contributor
George Koehler
George Koehler
Contributor
Julien Schueller
Julien Schueller
Contributor
Tianqi
Tianqi
Contributor
Kohei Takahashi
Kohei Takahashi
Contributor
Debian User
Contributor
Michał Janiszewski
Michał Janiszewski
Contributor
Neale Ferguson
Neale Ferguson
Contributor
Andreas Krebbel
Andreas Krebbel
Contributor
Harald van Dijk
Harald van Dijk
Contributor
Nikolai Kochetov
Nikolai Kochetov
Contributor
Lluís Batlle i Rossell
Lluís Batlle i Rossell
Contributor
Sean Baxter
Sean Baxter
Contributor
Calvin Buckley
Calvin Buckley
Contributor
Douglas Gregor
Douglas Gregor
Contributor
Eduard Voronkin
Eduard Voronkin
Contributor
Felix L
Felix L
Contributor
Philippe Daouadi
Philippe Daouadi
Contributor
Zhang Na
Zhang Na
Contributor
Stephen Kelly
Stephen Kelly
Contributor
Daniela Engert
Daniela Engert
Contributor
Romain Geissler
Romain Geissler
Contributor
Hartmut Kaiser
Hartmut Kaiser
Contributor
Clément Chigot
Contributor
Vladimir Prus
Vladimir Prus
Contributor
SSE4
SSE4
Contributor
brad0
brad0
Contributor
David Seifert
David Seifert
Contributor
Erik Schnetter
Erik Schnetter
Contributor
Rosen Penev
Rosen Penev
Contributor
Yao Yao
Yao Yao
Contributor
yhsb2k
Contributor
Brian Kuhl
Brian Kuhl
Contributor
Evan Miller
Evan Miller
Contributor
Andrey Semashev
Andrey Semashev
Contributor
Jürgen Hunold
Jürgen Hunold
Contributor
Ilia K
Ilia K
Contributor
Mohammad Bahoosh
Mohammad Bahoosh
Contributor
Axel Ismirlian
Axel Ismirlian
Contributor
Zhe Wang
Zhe Wang
Contributor
Evgeny Shapovalov
Contributor
Inseok Lee
Inseok Lee
Contributor
Debian User
Contributor
Aaron Gorenstein
Aaron Gorenstein
Contributor
Alexander 'z33ky' Hirsch
Alexander 'z33ky' Hirsch
Contributor
Thomas Kent
Thomas Kent
Contributor
Théo DELRIEU
Théo DELRIEU
Contributor
Augusto Hack
Contributor
tux3
tux3
Contributor
Daniel Glaser
Contributor
Shawn Anastasio
Shawn Anastasio
Contributor