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

Function initialize_threads

Tools/ftscalingbench/ftscalingbench.py:384–398  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

382
383
384def initialize_threads(opts):
385 if opts.threads == -1:
386 cpus = determine_num_threads_and_affinity()
387 else:
388 cpus = [None] * opts.threads # don't set affinity
389
390 print(f"Running benchmarks with {len(cpus)} threads")
391 for cpu in cpus:
392 inq = queue.Queue()
393 outq = queue.Queue()
394 in_queues.append(inq)
395 out_queues.append(outq)
396 t = threading.Thread(target=thread_run, args=(cpu, inq, outq), daemon=True)
397 threads.append(t)
398 t.start()
399
400
401def main(opts):

Callers 1

mainFunction · 0.85

Calls 4

startMethod · 0.95
QueueMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…