Search Unity

Is there a reason to why the Run extensions for Jobs return JobHandles?

Discussion in 'Entity Component System' started by Zec_, Feb 22, 2020.

  1. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    As stated in the title, why do the Run extension methods for Jobs return JobHandles? This has been bugging me for a while, as I can't see why they would return anything relevant. Since the jobs are Run on the main thread, there should be no input dependency left after the job been executed, leading me to assume that they always return a default value. Am I wrong in this assumption?

    The codegen ForEach-methods don't return JobHandles when executing them via Run (which makes sense), so why would normal jobs return a JobHandle when executing them via Run?