4 ms·
> In the extreme cases (and ultra-small sizes like 2 or 3), we can even run into deadlocks (!). If this happens to you, you're doing it wrong. You have deadlo
by heavenlyhash 10y ago
> In the extreme cases (and ultra-small sizes like 2 or 3), we can even run into deadlocks (!).
If this happens to you, you're doing it wrong. You have deadlocks; they just aren't happening "usually" unless you're "unlucky"... but happen they will!
Build your program to run correctly when all queues are buffer size of 1. If it doesn't work, you're doing it wrong.
Now raise the buffer sizes to something reasonable to reduce the performance frictions of too-strict scheduling. You will never have deadlocks.
- jcbeard 10y agoAgreed. If having deadlocks, then there's likely a cyclic dependency the programmer/author didn't consider. This happens a lot in streaming/data-flow code. Worse, something in the queue that's wonky. Seems to happen on multi-arch lockless FIFO's when the authors didn't consider corner cases of architectures with more relaxed coherence, or architected features (e.g., 128 vs. 64-byte cache lines).
- no-bugs 10y ago> If this happens to you, you're doing it wrong. Except for some corner cases - you're right, probably I should add a note about it...