Comment by philippta
7 hours ago
The fundamental problem here is shared memory / shared ownership.
If you assign exclusive ownership of all accounting data to a single thread and use CSP to communicate transfers, all of these made up problems go away.
Yes, multithreaded problems go away on a single thread.
Is there any way for an external thread to ask (via CSP) for the state, think about the state, then write back the new state (via CSP)?
If so, you're back to race conditions - with the additional constraints of a master thread and CSP.
CSP suffers from backpressure issues (which is not to say its bad, but it's not a panacea either)