Created
May 16, 2011 06:22
-
-
Save juque/974005 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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