3 ms·
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 co
by philippta 11mo 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.
- torginus 11mo agoCSP suffers from backpressure issues (which is not to say its bad, but it's not a panacea either)
- mrkeen 11mo agoYes, 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.
- philippta 11mo agoThat would be shared ownership again.
- mrkeen 11mo agoSo then I would sell STM to you from the "other end". Everyone else has multiple threads, and should replace their locks with STM for ease and safety. You've got safe single-thread and CSP, you should try STM to gain multithreading and get/set.
- gpderetta 11mo agoThis is equivalent of using a single global lock (and STM is semantically equivalent, just theoretically more scalable). It obviously works, but greatly limits scalability by serializing all operations. Also in practice the CSP node that is providing access control is effectively implementing shared memory (in an extremely inefficient way). The fundamental problem is not shared memory, it is concurrent access control. There's no silver bullet.