let's say i have something similar to:
def worker(name):
time.sleep(10)
print name
return
thrs = []
for i in range(1000):
t1 = threading.Thread(target=worker, args=(i,))
thrs.append(t1)
for t in thrs:
t.start()
Is there way to specify how many threads can run in parallel? in the above case, all 1000 will run in parallel