Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread blocking while waiting for Jobs to complete #38

Open
RagnarGothur opened this issue Nov 4, 2024 · 0 comments
Open

Thread blocking while waiting for Jobs to complete #38

RagnarGothur opened this issue Nov 4, 2024 · 0 comments

Comments

@RagnarGothur
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant