Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Resolved Details about IJobExtensions.ByRef

Discussion in '2022.2 Beta' started by Peaceultime, Jul 27, 2022.

  1. Peaceultime

    Peaceultime

    Joined:
    Aug 29, 2017
    Posts:
    1
    The 2022.2 beta introduced the ByRef methods for the jobs.
    In the manual, it is said that "The C# Job System solves this by sending each job a copy of the data it needs to operate on, rather than a reference to the data in the control thread. This copy isolates the data, which eliminates the race condition."
    Now that we can send a reference to each job, I am wondering if the safety system is disabled by default, or if it still try to check any race condition, even if there is no copy of the job struct?
     
  2. Luxxuor

    Luxxuor

    Joined:
    Jul 18, 2019
    Posts:
    89
    ByRef just means that the job struct itself is passed by reference instead of copied over, useful only for the edge cases where you a very large job struct. Safety system has nothing to do with it.