Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ScheduleBatchedJobs()

Makes Schedule methods available to worker threads.
Read time 1 minuteLast updated 22 days ago

Definition

  • Type: Method
  • Namespace: Unity.Jobs
  • Assembly: UnityEngine.CoreModule
public static void ScheduleBatchedJobs()

Remarks

By default, jobs are only put on a local queue when using job Schedule methods.
ScheduleBatchedJobs
makes them available to the worker threads to execute. The job system intentionally delays job execution until you call
ScheduleBatchedJobs
manually because the cost of waking up worker threads can be expensive. It's best practic to delay waking up worker threads until a few jobs have been scheduled. If you're scheduling jobs in a loop, wait to schedule the jobs until the end of the loop. If you do significant amounts of work on the main thread between scheduling jobs, then it can make sense to
ScheduleBatchedJobs
between each job.