TLeonardUK/libjobs

Support for UNIX machines (and alternate Windows support) by means of fcontext_t (or something similar)

Opened this issue · 0 comments

Boost.Context supports UNIX operating systems by performing the context switching (at assembly level) itself. For UNIX, ucontext_t could also be used, but it is slower than fcontext_t and it seems it's deprecated, but still usable in most platforms and safer than fiddling with the stack pointer directly.

Performance on Windows could also be theoretically improved using fcontext_t, but it becomes less safe, potentially sacrifices debugging ability (so it should be used only for Release builds) and requires turning global optimization off.

With the rise of Linux gaming and for the sake of supporting Linux and macOS machines, it could be an interesting addition to look towards.