14 ms·
But locks and shared memory aren't necessary for deadlock. You can easily deadlock with high level concepts. For example you can deadlock reading from channels,
by kevincox 1y ago
But locks and shared memory aren't necessary for deadlock. You can easily deadlock with high level concepts. For example you can deadlock reading from channels, or the classic deadlock of waiting for a process to end before reading its output (which works if the output is small!).
There are definitely coding patterns that can help with deadlocks, like unbounded queues and avoiding cases where you are waiting on events from multiple sources in one task. But I haven't heard of a comprehensive way to solve them completely.