22. Multi-threaded
This makes sense:
threads = [!
threading.Thread(target=download_a_url())!
for _ in range(10)]!
!
for t in threads:!
t.start()!
!
for t in threads:!
t.join()!
23. Multi-threaded
This makes no sense:
threads = [!
threading.Thread(target=do_calculations())!
for _ in range(10)]!
!
for t in threads:!
t.start()!
!
for t in threads:!
t.join()!
24. Gevent
from gevent import monkey!
monkey.patch_all()!
!
threads = [!
threading.Thread(target=download_a_url())]!
!
for t in threads:!
t.start()!
!
for t in threads:!
t.join()!
actually a greenlet