3 ms·
> Rust threading is only safe between threads accessing data structures in process own memory. "Only". Intra-process shared memory is by far the most important
by adwn 4y ago
> Rust threading is only safe between threads accessing data structures in process own memory.
"Only". Intra-process shared memory is by far the most important kind of shared memory. 80% of the time you see someone advocating for message-passing multi-process over shared memory multi-thread concurrency or parallelism, it's because shared mutable memory is incredibly hard to get right in just about every mainstream language except for Rust.
> It does nothing for shared resources using OS IPC, or external resources shared among threads.
Only partially true. The very same language constructs which make shared memory safe can also be used to create safe wrappers for other shared resources.
- pjmlp 4y agoNot in the age of microservices. Language constructs only help if there are no other applications accessing the same resources.
- adwn 4y ago> Not in the age of microservices. There's a huge world outside of microservices. > Language constructs only help if there are no other applications accessing the same resources. You're mistaken. Rust's language constructs can often help you write safe wrappers around inter-process communication and synchronization mechanisms. Of course, all bets are off if the other processes don't adhere to the agreed-upon IPC protocol, but that's not the point. The point is that Rust makes it easier to not accidentally screw up the protocol yourself.