You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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 theresize
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 Ipush
the functions there is onlythread 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!
The text was updated successfully, but these errors were encountered: