Re:Multi-core scaling: it’s not multi-threaded
by robertgraham on Thursday February 21, 2013 @06:12PM
(#5261277)
The entire point of the post was talk about "lock-free" algorithms where two cores can make forward progress without either having to wait or spin.
What systems have mutexes that aren't built like futexes?
Re:Multi-core scaling: it’s not multi-threaded
by javert on Thursday February 21, 2013 @07:14PM
(#5261627)
Kernels, and probably any kind of parallel user-level runtime like Erlang.
Re:Multi-core scaling: it’s not multi-threaded
by jamesaguilar on Thursday February 21, 2013 @05:54PM
(#5261172)
> I don't think that's a valid generalization at all.
Especially given he was complaining about syscall costs . . . which are nonexistent with futexes . . .
Re:Multi-core scaling: it’s not multi-threaded
by robertgraham on Thursday February 21, 2013 @06:14PM
(#5261285)
They are NOT non-existent, they happen a lot in contention. That's why code fails to scale: as you add CPUs, contentions happen a lot more often, and the number of syscalls shoot through the roof.
Re:Multi-core scaling: it’s not multi-threaded
by jamesaguilar on Thursday February 21, 2013 @06:22PM
(#5261328)
But the cost is not the syscalls . . . it's all those threads getting stopped, swapping memory in and out of the cache, etc. The syscall cost is minor by comparison.
At any rate, you've definitely overstated the case against mutexes in this post. At most, the advice should have been "avoid designs that will suffer from a lot of contention" like locking with lots of shared mutable state. It really has nothing to do with threads-vs-processes as you've made it out to do.
True, there are scenarios when you might prefer to spin, but they're pretty specialized.
My blog post was quite clear that I'm talking about futexes
No, you never mention the word "futex."
When somebody says "mutex", you have to assume they already mean "futex".
I don't think that's a valid generalization at all.