- 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.
24 lines
339 B
C#
24 lines
339 B
C#
namespace Misaki.HighPerformance.Jobs;
|
|
|
|
public readonly ref struct JobExecutionContext
|
|
{
|
|
public int ThreadIndex
|
|
{
|
|
get; init;
|
|
}
|
|
|
|
public IJobScheduler JobScheduler
|
|
{
|
|
get; init;
|
|
}
|
|
|
|
public object? State
|
|
{
|
|
get; init;
|
|
}
|
|
|
|
public JobHandle SelfHandle
|
|
{
|
|
get; init;
|
|
}
|
|
} |