Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved How close are we to getting Burst-compatible atomic bitwise operations

Discussion in 'Scripting Dev Blitz Day 2023 - Q&A' started by DreamingImLatios, Feb 23, 2023.

  1. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,217
    There's a lot of really cool algorithms I could implement to speed stuff up in ECS if I had these.
     
  2. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Hi @DreamingImLatios - do you mean things like `System.Threading.Interlocked.And` and `System.Threading.Interlocked.Or`?

    If so, Burst does support our own version of those: https://docs.unity3d.com/Packages/c...ics-common.html#interlockedand--interlockedor

    We had to make our own version of those APIs, rather than System.Threading.Interlocked, because `And` and `Or` were only added in .NET 5, so those APIs aren't yet available in Unity. We made our APIs experimental with the expectation that we'll deprecate / delete them when the .NET APIs become available.
     
  3. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,217
    Awesome! I may start experimenting with them!

    FYI, they are not mentioned anywhere in the changelog, which is why I never noticed their addition.
     
  4. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    It's the first entry in the changelog for 1.8.0 - but admittedly, it would have been a lot more useful if we'd have listed what the APIs actually are :)
     
    DreamingImLatios likes this.
  5. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,217
    Indeed it is! I can't believe I missed that. Thank you so much!