I have spawned multiple python processes and threads like:
from multiprocessing import Process
from threading import Thread
def thread():
pass
#some job
def process(threads_nr):
for i in range(threads_nr):
d = Thread(target=thread,args=())
d.setDaemon(True)
d.start()
data_list = ['group1','group2']
for data in data_list:
proc = Process(target=process, args=(2,))
proc.daemon = True
proc.start()
#doing something else
and noticed that all threads are running on same cpu (the cpu nr is on the left):
does anybody have any idea why ?