4 ms·
> However, this post is, in part, about how to implement locks. I haven't read the article in-depth but yeah, it seems like it maybe would have been better tit
by taneq 9y ago
> However, this post is, in part, about how to implement locks.
I haven't read the article in-depth but yeah, it seems like it maybe would have been better titled "What every C++ systems programmer should know about std::atomic". Which is still cool but from the title I was expecting some fancy voodoo algorithms for threadsafe non-locking FIFO queues or something.
- buserror 9y agoCompletely agree with this, the topic is much wider than the meat of the paper. A bit of a clickbait here.
- banachtarski 9y agoI think it's meant to be pretty fundamental. It's not supposed to include "voodoo algorithms" because it literally says "what every systems programmer should know...". The voodoo algorithm is a voodoo algorithm because not everyone needs to know it. In contrast, a mutex and all of that stuff is a consequence of how memory sequencing on a CPU works. If you understand those concepts, the rest is a hop, skip, and a jump away.
- taneq 9y agoI guess my beef was mostly in response to the word "lockless", which I'd hoped meant "not using any wait-for-other-thread type semantics" but in this context seems to mean "implementing locking without using OS-provided locking primitives, although standard library is fine." I was hoping that there was some cool new trick I'd missed or fundamentally different way to do concurrency than locking. I get disappointed easily in cases like this. :/
- johndubchak 9y agoI think that might be what parts of this upcoming release might contain: https://www.amazon.com/C-Concurrency-Action-Anthony-Williams/dp/1617294691/ref=sr_1_2?ie=UTF8&qid=1509644435&sr=8-2&keywords=Anthony+Williams+C%2B%2B+Concurrency+in+Action https://www.amazon.com/C-Concurrency-Action-Anthony-Williams...
- Animats 9y agoMe too. If you can do lockless add-to-queue and remove-from-queue, that's valuable. It's hard to get that right, especially on non x86/amd64 platforms. Every network packet, and often every interrupt, goes through a queue operation like that. Not stalling the other CPUs on each interrupt is important.