• SorteKanin@feddit.dk
    link
    fedilink
    arrow-up
    3
    ·
    19 days ago

    Threads giving you race conditions? All concurrent programming will do that if you’re shit at it.

    Well, if you write Rust then there won’t be race conditions.

    • _stranger_@lemmy.world
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      19 days ago

      Only in the context of data within the rust code. If you’re writing threaded rust that interfaces with external IO, for example, you can still get bit by a race condition. A person can absolutely be shit enough to hit a race condition in rust.

      • SorteKanin@feddit.dk
        link
        fedilink
        arrow-up
        2
        ·
        19 days ago

        interfaces with external IO

        How would you run into a race condition like this with safe Rust? You can’t share mutable file handles between threads for example. I’m not sure you’re correct in saying its still possible. Even if it is, it doesn’t sound easy.

    • chunkystyles@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      19 days ago

      Rust is great, and I truly mean that. But saying you can’t get race conditions in Rust is just not true.

      And also, not everything is going to be written in Rust. When the company you’re working for needs a web application quickly, that’s better done in other languages.

      And also also, Spring has a lot of niceties when it comes to concurrency that make this much less of a point.

      • SorteKanin@feddit.dk
        link
        fedilink
        arrow-up
        2
        ·
        19 days ago

        You can’t get data races at least, and in practice it’s very difficult to get actual race conditions.