Hi, say theres some pre-job clean up that has to happen that depends on managed types (so it can't be done inside the job). You don't want to do the clean up while dependent jobs are running so you Complete(); but then while you are doing the clean up (in the main thread) it's possible for a scheduled job to start mid-way that modifies the same NativeArray for example. So first question challenges the premise: is it possible for a job that was scheduled earlier in the main thread, to start up later on in the main thread between a .Complete() of the job in question, and where you start to clean up the values passed to it?
If so, second question: can you lock any scheduled jobs from starting for a short window of time?
I have attached a screenshot of what I'm talking about. Specifically where I call for the targetFence handle to complete (any job that modifies targetDistances sets this handle) and then clear the array right after.