Green Threads Explained in 200 Lines of Rust
Green threads, userland threads, goroutines or fibers, they have many names but for simplicity’s sake I’ll refer to them all as green threads from now on.
In this article we explore how they work by implementing a very simple example where we create our own green threads in 200 lines of Rust code. We’ll be explaining everything along the way so our main focus here is to understand them and learn how they work by using simple, but working example. It’s fine if you are curios and don’t know Rust, it’s just 200 lines anyway.