Last active
March 2, 2018 14:25
-
-
Save alexcambose/47c5e870b6c9dbb60ca21ed4a3803b0a to your computer and use it in GitHub Desktop.
This file contains 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 time | |
import urllib.request | |
global x; | |
x=0 | |
def workf(): | |
global x; | |
while True: | |
urllib.request.urlopen('http://') | |
x=x+1 | |
print('had request', x) | |
for _ in range(100): | |
t = threading.Thread(target=workf) | |
t.setDaemon(True) | |
t.start() | |
while True: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment