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

Listing 9.6: the local_work_queue is always nullptr #25

Open
Chen-Xuming opened this issue Sep 4, 2022 · 1 comment
Open

Listing 9.6: the local_work_queue is always nullptr #25

Chen-Xuming opened this issue Sep 4, 2022 · 1 comment

Comments

@Chen-Xuming
Copy link

In the function worker_thread(), "local_work_queue" call reset() and then it's not NULL.
However, in the function submit(), this variable is always nullptr, so the tasks are pushed into global queue.
Why?

@Chen-Xuming
Copy link
Author

My opinion: submit() is called in the main thread, but work_thread() is running in the sub-thread, so their thread_local variable "local_work_queue" are different.
Therefore, the condition if(local_work_queue) is always false.

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