Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

How to know how much job time used on thread sync of NativeContainers?

Discussion in 'Data Oriented Technology Stack' started by TMPxyz, Jul 11, 2019.

  1. TMPxyz


    Jul 20, 2012

    I've doubt that some non-negligible time is wasted in jobs due to write-sync on containers, but the profiler's timeline only gives blue bars of total time.

    Can I find out the exact time wasted on waiting?
  2. snacktime


    Apr 15, 2013
    You should read through this.

    The job system is based on single writer principle. The idea being nothing is writing to the same containers in a way where synchronization is required. ParallelFor type jobs hand you an index into the native container in question so that only a single thread is writing to the same value. Or in the case of higher level jobs like IJobForEach it handles that level of detail for you.

    Sync points do show in the profiler as waiting for job group, wait for semaphore. If there are jobs not finished that it has to wait on.
    Abbrew likes this.