Python Forum
waiting for many processes in parallel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
waiting for many processes in parallel
#1
i have started about 20 processes using subprocess.Popen(command,stdout=PIPE) and have gotten EOF on all their pipes. now i want the parent script to wait for all of them to exit. for various reasons some could take several minutes to exit. i'd like to allow up to 5 minutes for the whole bunch. is there a way to wait for them all as a group with just a single timeout? normally i would just for loop through the list of objects i got from Popen and call each.join(). but putting the 300 second timeout in there could end up being a long time if several are slow. is there a better way to wait for them all while giving up after 5 minutes?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
waiting for many processes in parallel - by Skaperen - Aug-30-2019, 12:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Waiting for input from serial port, then move on KenHorse 3 4,317 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  pip stops waiting for python walker 6 2,963 Nov-28-2023, 06:55 PM
Last Post: walker
  processes shall be parallel flash77 4 2,051 Sep-20-2022, 11:46 AM
Last Post: DeaD_EyE
  Waiting for heavy functions question philipbergwerf 14 5,968 Apr-29-2022, 07:31 PM
Last Post: philipbergwerf
  How to create waiting process? samuelbachorik 4 3,299 Sep-02-2021, 05:41 PM
Last Post: bowlofred
  Killing processes via python Lavina 2 4,343 Aug-04-2021, 06:20 AM
Last Post: warnerarc
  Waiting and listening test 2 3,076 Nov-13-2020, 04:43 PM
Last Post: michael1789
  sharing variables between two processes Kiyoshi767 1 2,601 Nov-07-2020, 04:00 AM
Last Post: ndc85430
  2 or more processes on the write end of the same pipe Skaperen 4 5,980 Sep-27-2020, 06:41 PM
Last Post: Skaperen
  waiting for barcode scanner output, while main program continues to run lightframe109 3 6,383 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020