Starting threads

Lukas Kubin kubin at opf.slu.cz
Tue Jan 28 10:45:52 EST 2003


I'm doing Python threads for the first time. In the following code I need
to use the time.sleep(.005) for the thread to executed right. Otherwise it
"omits" the first threads.
The doTheAction() function is a socket operation which I need to connect
parallelly to multimple computers. What am I doing wrong?
Thank you.


import threading

class Control(threading.Thread):

  def run(self):
    doTheAction()

if __name__ == '__main__':

  for comp in Computers:
    thread = Control()
    thread.start()
    time.sleep(.005)   # <-- This is what I still need to use

-- 
Lukas Kubin

phone: +420596398285
email: kubin at opf.slu.cz

Information centre
The School of Business Administration in Karvina
Silesian University in Opava
Czech Republic
http://www.opf.slu.cz





More information about the Python-list mailing list