On 20/05/2015 16:42, Alain Ketterlin wrote:
Robin Becker <ro...@reportlab.com> writes:
.............
The code I used to use with os.spawnl was even worse in leaving
zombies around.

For the same reason (os.wait() and os.waitpid() let you ... wait for
child-processes).

I suppose I needed to keep a record of all the pid's and wait on them
at some convenient time.

Yes.

The subprocess version appears to be doing that for me somehow.

Not sure what you mean. You have to do the bookkeeping yourself.
It seems there is some notion of book keeping in subprocess.py
Popen instances have a __del__ method which records un-norwegian live instances in a module global _active

if self.returncode is None and _active is not None:
    # Child is still running, keep us alive until we can wait on it.
   _active.append(self)


when another Popen is created there's a call to _cleanup which processes that list and reaps those that can be raptured.



(But, does beep really take so much time that you can't just call() it?)

not really, it's just normal to keep event routines short; the routine which beeps is after detection of the cat's entrance into the house and various recognition schemes have pronounced intruder :)

Probably should all have gone into a separate thread, but I dislike threaded code and I would probably get into trouble with the PyQT event loop.

-- Alain.



--
Robin Becker

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to