7
submitted 2 weeks ago by vi21@lemmy.ml to c/rust@lemmy.ml

cross-posted from: https://lemmy.ml/post/51402479

I guess Goish might be hated by many Rust fans and Go fans. Anyway, below is the example taken from its website.

use goish::{go, KB};
use goish::sync::WaitGroup;

#[goish::main]
fn main() {
    let wg = &WaitGroup::new();
    wg.Add(1_000_000);

    for i in 0..1_000_000 {
        // Explicit 2 KiB stack, sub-page allocated from the chunked
        // stackpool - the opt-in for extreme spawn density. Everyday
        // code just writes go!(move || ...) and never sizes a stack.
        go!(stack(2 * KB), move || {
            do_work(i);
            wg.Done();
        });
    }

    wg.Wait();
}
you are viewing a single comment's thread
view the rest of the comments
[-] NewOldGuard@lemmy.ml 8 points 1 week ago
this post was submitted on 15 Aug 2026
7 points (68.4% liked)

Rust Programming

9363 readers
3 users here now

founded 7 years ago
MODERATORS