4 ms·
If you don't copy it and don't wait on any synchronisation mechanisms, how do you protect the memory?
by laythea 9y ago
If you don't copy it and don't wait on any synchronisation mechanisms, how do you protect the memory?
- kccqzy 9y agoYou don’t need to protect it if every thread only ever reads it without writing.
- laythea 9y agoSomeone writes to it. And if they write before the read threads are run (and never again), then this is not really equivalent to the complexity we imagine when we say complexity in the context of multi-threading.
- kccqzy 9y agoYou are misunderstanding me. When I said no thread ever writes to it, I truly mean no one. There’s not a possibility of “someone writing to it.” And I think you also have a very narrow view of multi-threading. Shared memory, mutable-everything isn’t the only way of doing multi-threading (or more precisely concurrency). This very article is trying to introduce to you a new way of doing concurrency that doesn’t involve mutable variables shared between threads.