Skip to content

Comment on Microsoft confirms "eliminate C and C++" plan, translate code to Rust using AIparent

Comments

Thanks. I actually don't know much about concurrency/lock so I just took whatever the post said. I shall quote:

    Galen Hunt  Author
    Distinguished Engineer at Microsoft
    3d
    @Sukesh Ashok Kumar No memory safety. No concurrency safety. Of course, for a     single C or C++ code base, these qualities can be achieved with extraordinary discipline and effort--and lost with just a single mistake. With Rust, can be proven by the compiler.

I see, most likely thread-safety then. Rust will prevent accessing data shared between threads unless you first lock a mutex, use an atomic, etc.

Or rather, it gives abstractions so that higher-level types in stdlib and other libraries can prevent such access. The low-level implementation of the Mutex/etc types themselves do the same thing C and C++ do, via unsafe blocks, atomic primitives, fences, etc.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.