3 ms·
> Eliminating deadlocks in general isn't possible in a Turing-complete language. It is possible. For example, you could just remove threads and synchronization
by pcwalton 11y ago
> Eliminating deadlocks in general isn't possible in a Turing-complete language.
It is possible. For example, you could just remove threads and synchronization primitives. :)
But it's not easy -- IMO, compared to data races it's much harder to eliminate deadlocks statically without restricting expressiveness too much. It's even harder if you count I/O related deadlocks as deadlocks (e.g. deadlocking reads on Unix pipes).
- kibwen 11y agoBah, I should have been more precise with my terminology. :P I tend to consider an infinite loop a form of deadlock, even if it only involves a single unit of execution.