Skip to content

Instantly share code, notes, and snippets.

@alexcambose
Last active March 2, 2018 14:25
Show Gist options
  • Save alexcambose/47c5e870b6c9dbb60ca21ed4a3803b0a to your computer and use it in GitHub Desktop.
Save alexcambose/47c5e870b6c9dbb60ca21ed4a3803b0a to your computer and use it in GitHub Desktop.
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