Hacker News new | ask | show | jobs
by ViewTrick1002 20 days ago
Isn't this moving the goalposts quite far from where we began? Like a resoundly 2026 take given that having programs work concurrently and/or in parallel has been normalized by languages like Rust, Javascript and so on.

It wasn't that many years ago when getting anything more than 4 cores for a gaming PC was seen as a waste because most games couldn't even use 4 threads.

1 comments

Nope, the goal is still there, multiple threads accessing a specific memory location, that happens to be mapped outside the process, or a variable holding a database connection that is shared across multiple threads, and there are no Sendable trait implementations that can prevent that.

Threads and concurrency is not the same by the way, as Rob Pike puts it, "concurrency is not parallelism".

You did move the goal posts, though. Go famously has no protection against data races within the same process, leading to Undefined Behavior.

Why did you start talking about multiple processes? That's a much less common way to do concurrency these days.

Process-shared memory is an OS-specific feature with wildly diverging semantics, and it's not possible to write a memory-safe portable abstraction over that in any language. Windows comes the closest with mandatory file locking. On Linux there's nothing you can do but pray. Hence, `mmap()` is fundamentally unsafe in Rust, and that's perfectly fine.