Thread blocking while waiting for Jobs to complete
Opened this issue · 0 comments
RagnarGothur commented
Hi!
Am I correct in understanding that 1 thread of a CPU will always be blocked? I walked the callstack: JobHandle.Complete -> JobScheduler.Complete
and saw the following code:
if (job.TrySubscribe(handle.Version, out var waitHandle))
{
waitHandle.WaitOne();
job.Unsubscribe(handle.Version);
}
Am I correct in understanding that if I add 12 Jobs to a CPU with 12 threads, then 1 thread of the CPU will be blocked waiting and will not perform Job processing? And 1 Job will wait in the queue until some thread becomes free?
So on a CPU with 12 threads I will have only 11 doing useful work, and 1 will always be blocked waiting?