MCPcopy Create free account
hub / github.com/apache/impala / execute_many

Function execute_many

bin/bootstrap_toolchain.py:433–440  ·  view source on GitHub ↗

Executes f(a) for a in args using a threadpool to execute in parallel. The pool uses the smaller of 4 and the number of CPUs in the system as the pool size.

(f, args)

Source from the content-addressed store, hash-verified

431
432
433def execute_many(f, args):
434 """
435 Executes f(a) for a in args using a threadpool to execute in parallel.
436 The pool uses the smaller of 4 and the number of CPUs in the system
437 as the pool size.
438 """
439 pool = multiprocessing.pool.ThreadPool(processes=min(multiprocessing.cpu_count(), 4))
440 return pool.map(f, args, 1)
441
442
443def create_directory_from_env_var(env_var):

Callers 1

mainFunction · 0.85

Calls 2

minFunction · 0.85
ThreadPoolMethod · 0.45

Tested by

no test coverage detected