Remix.run Logo
philippta 12 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.

mrkeen 10 hours ago | parent | next [-]

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.

philippta 4 hours ago | parent [-]

That would be shared ownership again.

mrkeen 3 hours ago | parent [-]

So 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.

torginus 11 hours ago | parent | prev [-]

CSP suffers from backpressure issues (which is not to say its bad, but it's not a panacea either)