Dice Question Streamline Icon: https://streamlinehq.com

Design of a cactus stack satisfying interoperability, linear scaling, and bounded memory

Construct a cactus stack (also known as a spaghetti stack) that simultaneously (i) is interoperable with a legacy/linear stack, (ii) supports a linear-scaling scheduler, and (iii) provides bounded and efficient memory use.

Information Square Streamline Icon: https://streamlinehq.com

Background

Within fully-strict fork-join parallelism under continuation stealing, task frames form a tree-of-stacks known as a cactus stack. This structure arises because stolen children cannot safely use their parent’s linear stack, leading to branches that must be linked while preserving strict nesting of lifetimes and pointer validity.

The authors highlight three simultaneous desiderata for a practical cactus stack: interoperability with existing linear stacks (to mix with legacy code and conventional call stacks), support for a linear-scaling scheduler (to achieve optimal parallel scalability), and bounded, efficient memory usage (to respect tight theoretical and practical memory bounds). Achieving all three at once has not been resolved, and the paper presents only a partial solution that sacrifices interoperability for performance and compatibility with stackless coroutines.

References

Designing a cactus stack that is simultaneously: 1) Interoperable with a legacy/linear stack 2) Supports a linear-scaling scheduler 3) Provides bounded and efficient memory use is an open research problem.

Libfork: portable continuation-stealing with stackless coroutines (2402.18480 - Williams et al., 28 Feb 2024) in Section 2.4 (Cactus stacks)