stack-switching VS gruvi

Compare stack-switching vs gruvi and see what are their differences.

stack-switching

A repository for the stack switching proposal. (by WebAssembly)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
stack-switching gruvi
2 1
112 94
8.9% -
9.4 10.0
2 days ago over 6 years ago
WebAssembly Python
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

stack-switching

Posts with mentions or reviews of stack-switching. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-24.
  • WasmFX: Effect Handlers for WebAssembly
    1 project | news.ycombinator.com | 7 Nov 2023
    I first heard of algebraic effects in a presentation about Unison recorded at Strangeloop. Realizing that exceptions, async, generators, and continuations could all be unified and implemented on top of one language feature was mind expanding.

    It looks like the juicy details are in the Explainer:

    https://github.com/WebAssembly/stack-switching/blob/main/pro...

  • Fiber in C++: Understanding the Basics
    8 projects | news.ycombinator.com | 24 Sep 2023
    "Fibers", "green threads", "stack switching", "cooperative multitasking" are essentially all the same thing, they all rely on being able to switch to a different stack within the same OS thread. As such they can be implemented either in user space or by the OS.

    Only downside of the technique is that it cannot be implemented in WASM, because WASM has separate data- and call-stacks and the call stack is not accessible from within the WASM virtual machine (while 'async-await' which relies on code transformation can be implemeneted in WASM just fine).

    There is a 'stack-switching proposal' for WASM though, but I don't know how what's the state of that:

    https://github.com/WebAssembly/stack-switching

gruvi

Posts with mentions or reviews of gruvi. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-24.
  • Fiber in C++: Understanding the Basics
    8 projects | news.ycombinator.com | 24 Sep 2023
    A disadvantage to the ‘no function coloring’ in fibers is that it makes lockless programming harder. A nested function call can switch from under you without your knowledge, making it hard to know where the preemption points are and whether to take locks when making updates to shared state. With function coloring you know exactly whether a function might switch or not.

    I’ve programmed both fiber based systems and coroutines. I even created my own fiber libraries for Python (https://github.com/geertj/gruvi) and C++ (https://github.com/geertj/cgreenlet, mostly an experiment, and incorrectly named coroutines for C++ while it’s really fibers). In the Python version I experimented with some features to help you know whether a nested function might switch.

    In the end, for me and for the problem domains I worked in, the explicit async/await co-routine style wins over fibers. It gives you most of the performance and memory benefits of user mode switching while keeping your code mostly lock free.

What are some alternatives?

When comparing stack-switching and gruvi you can also consider the following projects:

marl - A hybrid thread / fiber task scheduler written in C++ 11

context

ghost-userspace

llvm-project - The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

cgreenlet - Coroutines for C/C++

assembly - assembly projects