Skip to content

Instantly share code, notes, and snippets.

@davidbj
Created September 11, 2014 09:54
Show Gist options
  • Select an option

  • Save davidbj/b20f7498819140cbd449 to your computer and use it in GitHub Desktop.

Select an option

Save davidbj/b20f7498819140cbd449 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import threading
import time
class Mythreading(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
#self.daemon=True
def run(self):
while True:
print "thread...."
time.sleep(1)
def main():
threads=[]
for i in range(6):
t=Mythreading()
threads.append(t)
for t in threads:
t.start()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment