I'm running some C++ code (8 independent processes running on Ubuntu with 8 cores).
I'm launching the C processes using python:
def runC():
numThreads = multiprocessing.cpu_count()
threads = []
for i in range(numThreads):
args = ("./cprogram", arg1,arg2,arg3)
popen = subprocess.Popen(args, stdout=subprocess.PIPE,stderr=subprocess.PIPE)
threads.append(popen)
for t in threads:
t.wait()
output = t.stdout.read()
err = t.stderr.read()
if len(output) > 0:
print "output: " + output
if len(err) > 0:
print "err: " + err
I keep getting "defunct" processes. What does that mean? Why did this happen to me?