3 ms·
If "concurrency bugs" includes deadlocks, no, such a kernel would not be free of concurrency bugs. Any blocking receive operation on a channel can create deadlo
by pcwalton 6y ago
If "concurrency bugs" includes deadlocks, no, such a kernel would not be free of concurrency bugs. Any blocking receive operation on a channel can create deadlocks.
- robot 6y agoIt will be free of concurrency bugs including deadlocks. This is the promise of CSP. The requirement is data is shared only via blocking IPC and never directly using a lock. (and similarly one must not share a pointer to private data, as another poster has pointed out) You can compose small systems, even with multiple parties, prove they cannot deadlock, then make them a 'black box' with defined IO, and build larger, more complex systems with equal properties. The downside is you must guard every piece of shared data with a separate thread, but there may be ways to reduce the performance penalty.
- pcwalton 6y agoHow do you prevent process A from waiting on a receive from process B while process B waits on a receive from process A?