Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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.