• soulsource@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    22 days ago

    Yep. One reason why those situations become less frequent over tie is that one learns to avoid such designs. Thought process: “Sharing data across threads is annoying. So I’d rather avoid it. Maybe message passing can solve the same problem as well?”

    • trevor (he/they)@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      22 days ago

      I just use Arc::clone() now that I know I can just throw the problematic data types on the heap easily. I’m sure there are “better” ways to do it, but ¯\_(ツ)_/¯