Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在linux中使用python完成后未终止进程_Python_Linux_Process_Multiprocessing - Fatal编程技术网

在linux中使用python完成后未终止进程

在linux中使用python完成后未终止进程,python,linux,process,multiprocessing,Python,Linux,Process,Multiprocessing,我有一个python程序,一次只能运行10个进程。当第11个进程进入时,它将等待其他进程完成。在MS Windows环境中,当任务完成且其他进程能够运行时,进程将自行终止。但是在Linux环境中,进程即使在任务完成后也不会终止 我是否必须以某种方式清除/终止流程 for processIndex in range(0, noOfProccesesToRun): dataToProcess = inputData[0:fileSize] inputData = inputData[

我有一个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版

请添加python版本您正在调用
setrlimit
syscall…?不,我不知道该调用的作用是什么?请参阅手册页并阅读Ok,这将设置进程可以使用多少资源的限制,但主要问题是为什么进程在完成时不终止,而是进入了僵尸状态