Python Forum
how to clean up unstarted processes?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to clean up unstarted processes?
#1
i have called subprocess.Popen() several times and collected the results. normally i would .start() these processes. suppose i encounter a situation that i need to not run these processes, but still do other things (not just exit). how do i go about cleaning this up to recover any resources used, both in this process and any processes that were created by this (but not other processes that might be in other lists, possibly already started)?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
there are several bash commands that you can use to do this
https://www.servernoobs.com/how-to-find-...processes/
you should be able to run these using subprocess command from within python
Reply
#3
so when you create a process with child=subprocess.Popen() and don't child.start() it, it's a zombie? how do they get it into that state? and what does calling child.start() do to it?
Tradition is peer pressure from dead people

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can i clean this code ? BSDevo 8 941 Oct-28-2023, 05:50 PM
Last Post: BSDevo
  processes shall be parallel flash77 4 1,109 Sep-20-2022, 11:46 AM
Last Post: DeaD_EyE
  Clean Up Script rotw121 2 1,006 May-25-2022, 03:24 PM
Last Post: rotw121
  Sharing imported modules with Sub Processes? Stubblemonster 2 1,500 May-02-2022, 06:42 AM
Last Post: Stubblemonster
  How to clean UART string Joni_Engr 4 2,477 Dec-03-2021, 05:58 PM
Last Post: deanhystad
  Killing processes via python Lavina 2 2,605 Aug-04-2021, 06:20 AM
Last Post: warnerarc
  How to share a numpy array between 2 processes on Windows? qstdy 0 2,156 Jan-29-2021, 04:24 AM
Last Post: qstdy
  sharing variables between two processes Kiyoshi767 1 1,869 Nov-07-2020, 04:00 AM
Last Post: ndc85430
  2 or more processes on the write end of the same pipe Skaperen 4 3,860 Sep-27-2020, 06:41 PM
Last Post: Skaperen
  Errors using --processes parameter sonhospa 3 2,384 Jul-01-2020, 02:24 PM
Last Post: sonhospa

Forum Jump:

User Panel Messages

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