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

Resize thread pool #29

Open
claudiacorreia60 opened this issue Aug 13, 2020 · 0 comments
Open

Resize thread pool #29

claudiacorreia60 opened this issue Aug 13, 2020 · 0 comments

Comments

@claudiacorreia60
Copy link

Hi,

In my code I create a thread pool with only one thread, and then push all the functions that I want to execute. After that, while the functions are being executed by that thread, I use another thread (that doesn't belong to the thread pool) to increase the number of threads in the thread pool, using the resize method. However, the resizing has no effect since the new threads I added do not execute anything, only the first thread (thread 0) executes the functions that are still in the queue.

Does this happen because when I push the functions they are automatically associated with a thread? And in my case, since when I push the functions there is only thread 0 in the thread pool, all functions become associated with that thread?

Also, is there a problem in calling resize from a function outside the thread pool?

Thank you in advance for your help!

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