5 ms·
I would agree with GP comment: in the particular case described in the article using channels instead of lower-level primitives would solve the problem. E.g. w
by lostmsu 3y ago
I would agree with GP comment: in the particular case described in the article using channels instead of lower-level primitives would solve the problem.
E.g. when workers need to be stopped you close the channel sender, and receiver returns appropriate result to all wait calls.
- PaulDavisThe1st 3y agoThat's a highly specific solution that doesn't address the fundamental interplay between atomics and various kinds of synchronization primitives.
- lostmsu 3y agoThis objection of yours was directly addressed by the comment I'm trying to support. E.g. yes, it is important to know the low-level details, but also the abstraction chosen is just not fit for the purpose. And it's partially fault of C++ because channels are not in the standard library.