question about Jobs in SystemBase OnUpdate

i was curious about that, Inside SystemBase’s OnUpdate callback
if i do use Entities.ForEach with lambda to Schedule my job, when does unity automatic Complete this job for me, now the only thing i know is that it will completed before my SystemBase’s next time OnUpdate callback. but how it works internal? is there a Exact time point jobs get completed?

It depends when you schedule them to be updated.
See Entity Debugger, or DOTS Systems, to see, when your systems are updated.
System Groups helps organizing your order of updates.

If nothing else completed job (for example structural changes (synch point) or dependency chain complete (by other system or manually) ) then yes your job (if it in dependency chain) will complete before the next OnUpdate call of this system (keep in mind, job work itself can be done earlier than Complete call, it’s just “finishing” jobs chain, and only if job work didn’t finish - internal mechanism will give all resources (including main thread) to this jobs chain to finish and will wait while job is done). World update iterates through system groups and calls their update which calls update of child systems and groups and system Update contains step - BeforOnUpdate, this is the place where previous frame system job handle will complete.
6964367--820499--upload_2021-3-23_13-48-2.png6964367--820502--upload_2021-3-23_13-48-17.png

1 Like

Thanks! this is what i want to know