They beat M:N in terms of preemptive scheduling and signals. If we’re talking about golang, then they have cooperative scheduling for the first issue, and the second doesn’t really matter.
-
-
Replying to @MattDenton
They beat M:N for thread creation and destruction.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
NPTL beat a single implementation, and how much of that complexity was dealing with irrelevant issues like preemptive scheduling, signals, and the relative lack of thread support in the Linux kernel at the time?
1 reply 0 retweets 0 likes -
Replying to @MattDenton
Dunno! Probably worth doing measurement! We’ve done measurements in Rust and M:N didn’t appreciably beat 1:1 on modern Linux. Even with cooperative scheduling and no signals.
1 reply 0 retweets 0 likes -
Replying to @pcwalton @MattDenton
My preference for 1:1 isn’t theoretical: it’s based on trying M:N in Rust. I was in fact one of the biggest M:N holdouts until it became clear, based on data, that 1:1 was the way to go.
1 reply 0 retweets 1 like -
Replying to @pcwalton
And here’s something interesting about cooperative scheduling in Go:https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md …
1 reply 0 retweets 0 likes -
Replying to @MattDenton @pcwalton
So perhaps cooperative scheduling didn’t really work out? Basically long loops with no function calls means a goroutines can’t be preempted.
1 reply 0 retweets 0 likes -
Replying to @MattDenton
Right, that was a downside in Rust as well that led us to abandon M:N.
1 reply 0 retweets 1 like -
Replying to @pcwalton
Chrome’s concurrency model is the easiest I’ve ever worked in. It’s basically tasks on a thread pool, except tasks can be grouped into sequences. The tasks in a sequence can be run on different threads, but always in the order they were posted to the sequence.
2 replies 0 retweets 0 likes -
Replying to @MattDenton @pcwalton
Something like event based, but with a lot of the ergonomics of m:n threads. And you can write “single-threaded code” within any one task and it just works.
1 reply 0 retweets 0 likes
Even better: async/await, so you can write sequential-looking code that spans across tasks ;)
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.