MCPcopy Index your code
hub / github.com/python/cpython / _repopulate_pool_static

Method _repopulate_pool_static

Lib/multiprocessing/pool.py:315–331  ·  view source on GitHub ↗

Bring the number of pool processes up to the specified number, for use after reaping workers which have exited.

(ctx, Process, processes, pool, inqueue,
                                outqueue, initializer, initargs,
                                maxtasksperchild, wrap_exception)

Source from the content-addressed store, hash-verified

313
314 @staticmethod
315 def _repopulate_pool_static(ctx, Process, processes, pool, inqueue,
316 outqueue, initializer, initargs,
317 maxtasksperchild, wrap_exception):
318 """Bring the number of pool processes up to the specified number,
319 for use after reaping workers which have exited.
320 """
321 for i in range(processes - len(pool)):
322 w = Process(ctx, target=worker,
323 args=(inqueue, outqueue,
324 initializer,
325 initargs, maxtasksperchild,
326 wrap_exception))
327 w.name = w.name.replace('Process', 'PoolWorker')
328 w.daemon = True
329 w.start()
330 pool.append(w)
331 util.debug('added worker')
332
333 @staticmethod
334 def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue,

Callers 2

_repopulate_poolMethod · 0.95
_maintain_poolMethod · 0.80

Calls 5

ProcessClass · 0.70
replaceMethod · 0.45
startMethod · 0.45
appendMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected