Start 10 copies of a function running in parallel : Thread Start : Thread PYTHON examples


PYTHON examples » Thread » Thread Start »

 

Start 10 copies of a function running in parallel


Start 10 copies of a function running in parallel

import thread

def counter(myId, count):
    for i in range(count): print '[%s=> %s' % (myId, i)

for i in range(10):
    print thread.start_new(counter, (i, 100))

import time
time.sleep(3
print 'Main thread exiting.'  

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Thread
» Thread Start