feat(JobScheduler): improve dependency handling logic
Updated `JobScheduler` to enhance dependency tracking by counting valid dependencies upfront and dynamically adjusting counts using `Interlocked` operations. Improved job enqueueing logic to ensure jobs are only enqueued when all dependencies are met. Replaced `Interlocked.Increment` with `Interlocked.Add` for batch updates to `_totalJobCount`, improving performance. Adjusted `VirtualStack` cleanup to use the correct size variable for memory deallocation. Simplified `JobDispatchingJob` API by removing `ctx.ThreadIndex` parameter. Updated `TestJobSystem` to pass job handles as dependencies for proper execution order. Incremented assembly version to 1.5.9 to reflect these changes.
This commit is contained in:
@@ -199,7 +199,7 @@ public unsafe class TestJobSystem
|
||||
};
|
||||
|
||||
var handle1 = s_jobScheduler.ScheduleParallel(ref addJob, arraySize, 64);
|
||||
var handle2 = s_jobScheduler.ScheduleParallel(ref multiplyJob, arraySize, 64);
|
||||
var handle2 = s_jobScheduler.ScheduleParallel(ref multiplyJob, arraySize, 64, handle1);
|
||||
var handle3 = s_jobScheduler.Schedule(ref sumJob, handle2);
|
||||
|
||||
s_jobScheduler.Wait(handle3);
|
||||
|
||||
Reference in New Issue
Block a user