2

I have a Pool of tasks in my code, I want an event to happen once all the tasks in the pool are done. I know about join method but it is stopping my main process of tkinter app, I used a list of Processes and I checked that list using thread whether all the processes are done

Right now I am trying to do like this :

my_pool = [mp.Process(task).start() for task in tasks]
# checking if any process alive using a after method of tkinter
if not any(p.is_alive() for p in my_pool):
    # doing some event

I wonder if there is a way to do the same using mp.Pool instead of join(), because it is pausing the main UI of my app until all the process is done in that pool.

martineau
  • 119,623
  • 25
  • 170
  • 301
Indivar
  • 23
  • 5
  • 1
    My answer to the question [Freezing/Hanging tkinter Gui in waiting for the thread to complete](https://stackoverflow.com/questions/53696888/freezing-hanging-tkinter-gui-in-waiting-for-the-thread-to-complete) can probably be adapted to work with a multiprocessing `Pool` instead of multithreading. Be sure to use a `multiprocessing.Queue`. – martineau Apr 18 '20 at 14:41

0 Answers0