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

Function thread_run

Tools/ftscalingbench/ftscalingbench.py:371–381  ·  view source on GitHub ↗
(cpu, in_queue, out_queue)

Source from the content-addressed store, hash-verified

369
370
371def thread_run(cpu, in_queue, out_queue):
372 if cpu is not None and hasattr(os, "sched_setaffinity"):
373 # Set the affinity for the current thread
374 os.sched_setaffinity(0, (cpu,))
375
376 while True:
377 func = in_queue.get()
378 if func is None:
379 break
380 func()
381 out_queue.put(None)
382
383
384def initialize_threads(opts):

Callers 1

mock_runMethod · 0.85

Calls 3

funcFunction · 0.50
getMethod · 0.45
putMethod · 0.45

Tested by 1

mock_runMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…