Skip to content

Thread blocking while waiting for Jobs to complete #38

@RagnarGothur

Description

@RagnarGothur

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions