python - A thread pool that lets me know when at least 1 has finished? -


I need to use a thread pool in Python, and I want to know that after at least 1 time Or "Permission for maximum threads" has expired, so I can start it again if I need to do anything.

I am using something like this:

  def doSomethingWith (dataforthread): doostf () i = i-1 # thread ends I = 0 poolSize = 5 threads = [] Data = # of data while Lennon (data): while true: if i  

As I think, my code opens 5 threads, and then starts new threads for all threads Data is consumed before it ends, but what I really want to do I'll start a new thread as well as finish the thread, and the pool has "available space" for a new thread.

I have been reading, but I think that there will be only one issue in comparison to my code (not sure, new to python but includes all of this included) .

Does anyone have an example for what I am trying to achieve?

I mean as soon as I want to know & lt; Size compared to pool, i = poolSize until new threads are launched and so long as the data is not consumed.

An article writer is mentioned, and @getekha Highlights do not really fill thread pools in Python As a matter of the same thing they do in other languages. If you need equality, then you should look into it. Apart from the other things, there are these easy and constructed additions, besides, there you want to monitor.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -