MCPcopy Index your code
hub / github.com/geekcomputers/Python / cpu

Function cpu

simulate_memory_cpu.py:51–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def cpu():
52 arg = sys.argv[2] if len(sys.argv) == 3 else sys.argv[3]
53 cpu_num = cpu_count()
54 cores = int(arg)
55 if not isinstance(cores, int):
56 print("bad args not int")
57 return
58
59 if cores > cpu_num:
60 print("Invalid CPU Num(cpu_count=" + str(cpu_num) + ")")
61 return
62
63 if cores is None or cores < 1:
64 cores = 1
65
66 for i in range(cores):
67 Process(target=deadloop).start()
68
69
70def mem_cpu():

Callers

nothing calls this directly

Calls 1

startMethod · 0.80

Tested by

no test coverage detected