Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Details about IJobExtensions.ByRef

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

  1. Peaceultime


    Aug 29, 2017
    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


    Jul 18, 2019
    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.