logoalt Hacker News

dlisboa • today at 2:50 AM • 3 replies • view on HN

No. Preemptive scheduling plus M:N mapping combination that Go has is not common in other major implementations.

Other languages and their implementations of green threads usually have cooperative scheduling or M:1 mapping


Replies

seabrookmx • today at 6:01 AM

C# and Rust (via Tokio) both have M:N threading. They both use a work-stealing algorithm to map many tasks onto a finite thread pool. But you're correct that they are cooperative via async/await, not pre-emptive.

dwattttt • today at 3:05 AM

I'm curious; using hardware threads is M logical threads preemptively scheduled on N physical cores. In what way does this not satisfy the original criteria?

➕ show 2 replies
za3faran • today at 4:36 AM

Java's virtual threads are M:N.

➕ show 1 reply