Refactor JobExecutionContext, add scheduler state support
- Refactored JobExecutionContext to use init-only properties and added State and SelfHandle for richer context. - Updated JobInfo field layout for clarity and memory alignment. - JobScheduler now accepts and exposes an optional state object, passed to each job context. - Improved memory management by using _freeList for allocations and disposal. - WorkerThread and benchmarks updated to use new JobExecutionContext pattern. - Bumped version to 1.6.1 and performed minor code cleanup.
This commit is contained in:
@@ -84,6 +84,9 @@ internal unsafe struct JobInfo
|
||||
|
||||
public const int MAX_DEPENDENTS = 8;
|
||||
|
||||
public void* pJobData;
|
||||
public JobExecutionFunc pExecutionFunc;
|
||||
|
||||
// The list of jobs that are waiting for THIS job to complete.
|
||||
public fixed int dependentsID[MAX_DEPENDENTS]; // The actual list of IDs
|
||||
public fixed int dependentsGeneration[MAX_DEPENDENTS]; // The actual list of generations
|
||||
@@ -93,9 +96,6 @@ internal unsafe struct JobInfo
|
||||
|
||||
public JobRanges jobRanges;
|
||||
|
||||
public void* pJobData;
|
||||
public JobExecutionFunc pExecutionFunc;
|
||||
|
||||
public int state;
|
||||
public int remainingBatches;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user