I am trying to create different threads to work with 8 cores. However I see the code creates 8 threads but only uses around on 100% on my macos. Why?
def runner(i):
# do random stuff
for a in range(0,1000000):
i+=1
5000 / 34 * i
i + 400
i / 20000
i * 24440
i+=1
5000 / 34 * i
i + 400
i / 20000
q = queue.Queue()
threads = list()
for x in range(0,80):
th = threading.Thread(target=runner,args=(x,))
threads.append(th)
for th in threads:
th.start()
for th in threads:
th.join()