Green threads explained in 200 lines of Rust

Green threads explained in 200 lines of Rust

In this article I want to explore how they work by implementing a very simple example where we create our own green threads in 200 lines of Rust code. This is not the best way of displaying Rusts greatest strengths, its safety guarantees, but it does show an interesting use of Rust and the code is mostly pretty clean and easy to follow. Quentin Carbonneaux wrote an nice article back in 2013 which I used as inspiration for the main code example.

Source: cfsamson.gitbook.io