使用python在linux中完成后没有杀死进程

时间:2013-09-16 16:33:02

标签: python linux process multiprocessing

我有一个python程序,一次只能运行10个进程。当第11个进程进入时,它会等待其他进程完成。在MS Windows环境中,该过程在其任务完成且其他进程能够运行时终止。但是在Linux环境中,即使在完成任务后进程也没有终止?

我是否必须以某种方式清除/终止该过程?

for processIndex in range(0, noOfProccesesToRun):
    dataToProcess = inputData[0:fileSize]
    inputData = inputData[fileSize:len(inputData)]
    curObject = ImportCclToMixPanel(dataToProcess)
    process = Process(target=curObject.importData)
    if currentProcess:
        childProcesses = currentProcess.get_children(recursive=True)
        while len(childProcesses) >= MAX_PROCESSES:
            childProcesses = currentProcess.get_children(recursive=True)
    process.start()

 def importData:
     //do stuff
     print "exiting

使用python版本2.7.5

0 个答案:

没有答案