os_kernel_lab/related_info/lab7/semaphore_condition/thr-ex4.py

14 lines
319 B
Python
Raw Permalink Normal View History

import threading
class MyThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
print "I am %s" % (self.name)
if __name__ == "__main__":
for i in range(0, 5):
my_thread = MyThread()
my_thread.start()