• 3abas@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    2 hours ago

    That’s just bad interface… When you design an API as if operations were independent, but they aren’t, you run into these issues.

    Don’t add “cut through the lawyers” functions, fix your interface.

    • Buddahriffic@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 hour ago

      Yeah, well-designed abstraction can help enable more concurrency. That said, concurrency isn’t easy at any point once there’s shared data that needs to be written to during the process. Maybe it’s not so bad if your language has good concurrency support (like monitor classes and such that handle most of the locking behind the scenes), but even then, there’s subtle pitfalls that can add rare bugs or crashes to your program.