Skip to content

Instantly share code, notes, and snippets.

@juque
Created May 16, 2011 06:22
Show Gist options
  • Select an option

  • Save juque/974005 to your computer and use it in GitHub Desktop.

Select an option

Save juque/974005 to your computer and use it in GitHub Desktop.
import threading
import thread
import time
import sys
class MyThread(threading.Thread):
def __init__(self):
super(MyThread, self).__init__()
def run(self):
time.sleep(60*60)
if __name__ == "__main__":
print("Starting threading limit test")
while True:
try:
MyThread().start()
except(thread.error):
print("Maximum threads : %s" % threading.active_count())
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment