《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
319 B

  1. import threading
  2. class MyThread(threading.Thread):
  3. def __init__(self):
  4. threading.Thread.__init__(self)
  5. def run(self):
  6. print "I am %s" % (self.name)
  7. if __name__ == "__main__":
  8. for i in range(0, 5):
  9. my_thread = MyThread()
  10. my_thread.start()