RadonMetrics/CodeMetricsCalculator.py

changeset 54
f7a462d6ec26
parent 53
4a179abb79e6
child 60
cd2dd96c3c12
equal deleted inserted replaced
53:4a179abb79e6 54:f7a462d6ec26
88 initialTasks = 2 * NumberOfProcesses 88 initialTasks = 2 * NumberOfProcesses
89 for task in argumentsList[:initialTasks]: 89 for task in argumentsList[:initialTasks]:
90 taskQueue.put(task) 90 taskQueue.put(task)
91 91
92 # Start worker processes 92 # Start worker processes
93 for i in range(NumberOfProcesses): 93 for _ in range(NumberOfProcesses):
94 multiprocessing.Process(target=worker, args=(taskQueue, doneQueue))\ 94 multiprocessing.Process(target=worker, args=(taskQueue, doneQueue))\
95 .start() 95 .start()
96 96
97 # Get and send results 97 # Get and send results
98 endIndex = len(argumentsList) - initialTasks 98 endIndex = len(argumentsList) - initialTasks
118 118
119 if i < endIndex: 119 if i < endIndex:
120 taskQueue.put(argumentsList[i + initialTasks]) 120 taskQueue.put(argumentsList[i + initialTasks])
121 121
122 # Tell child processes to stop 122 # Tell child processes to stop
123 for i in range(NumberOfProcesses): 123 for _ in range(NumberOfProcesses):
124 taskQueue.put('STOP') 124 taskQueue.put('STOP')
125 125
126 126
127 def worker(inputQueue, outputQueue): 127 def worker(inputQueue, outputQueue):
128 """ 128 """

eric ide

mercurial