Can I do multithreads on each process of a multiprocess program?
For example, let say I have 4 cores available, can I add 30 threads to each of these 4 cores?
This might sound confusing so here's a sample code that shows my question better
from multiprocessing import Process
from threading import Thread
if __name__ == "__main__":
processes = []
for i in range(4):
processes.append(Process(target=target))
for p in processes:
# Can I add threads on each of these processes
# p.append(Thread(target=target2))
p.start()
for p in processes:
p.join()
This is not for a specific project it's just for my general knowledge. Thank you