I’m trying to improve job scheduling as well as memory usage by reusing most of my in between buffer jobs. for that i keep DataThreadCount numbers of my in between buffer jobs and reuse them and avoid error by saving the previous thread JobHandle and use it as dependency for the next one.
better explained with some pseudo code:
// params are: data it needs, buffer pool index to use, previous job handle that uses the buffer pool index as dependsOn
var handle = DoJobStuff(inputData, threadIndex, threadHandles[threadIndex]);
threadHandles[threadIndex++] = handle;
// threadCount= math.max((int)(JobsUtility.JobWorkerCount * threadsUsage), 1);
threadIndex %= threadCount;
//... inside DoJobStuff()
var handle = job1.Schedule(dependsOn); // uses pooled buffers for in between step1
handle = job2.Schedule(handle); // more pooled buffers for step2
handle = job3.Schdule(handle); // output, uses new, non pooled, output buffers
return handle;
Standard vs core vs framework is very confusing but unless you need specific access to one of the few libraries that only support .net framework 4 then I suggest sticking with standard.