Version: 2022.3

JobsUtility.MaxJobThreadCount

切换到手册
public static int MaxJobThreadCount ;

描述

The maximum number of job threads that the job system can create.

This maximum is the theoretical maximum that the job system supports. In practice, the maximum number of job worker threads that the job system creates is lower because the job system doesn't create more job worker threads than logical CPU cores on the target hardware. This value is useful for compile time constants, however when used for creating buffers it might be larger than what you need. If you want to allocate a buffer that can be subdivided evenly between job worker threads, use the runtime constant that JobsUtility.ThreadIndexCount returns. SA: Unity.Jobs.LowLevel.Unsafe.JobsUtility.ThreadIndexCount