Skip to content

Commit 9e6a15e

Browse files
authored
Final QA (#611)
1 parent 214480e commit 9e6a15e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

python-concurrency/cpu_processes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import concurrent.futures
21
import time
2+
from concurrent.futures import ProcessPoolExecutor
33

44

55
def main():
66
start_time = time.perf_counter()
7-
with concurrent.futures.ProcessPoolExecutor() as executor:
7+
with ProcessPoolExecutor() as executor:
88
executor.map(fib, [35] * 20)
99
duration = time.perf_counter() - start_time
1010
print(f"Computed in {duration} seconds")

python-concurrency/cpu_threads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import concurrent.futures
21
import time
2+
from concurrent.futures import ThreadPoolExecutor
33

44

55
def main():
66
start_time = time.perf_counter()
7-
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
7+
with ThreadPoolExecutor(max_workers=5) as executor:
88
executor.map(fib, [35] * 20)
99
duration = time.perf_counter() - start_time
1010
print(f"Computed in {duration} seconds")

python-concurrency/io_threads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import concurrent.futures
21
import threading
32
import time
3+
from concurrent.futures import ThreadPoolExecutor
44

55
import requests
66

@@ -19,7 +19,7 @@ def main():
1919

2020

2121
def download_all_sites(sites):
22-
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
22+
with ThreadPoolExecutor(max_workers=5) as executor:
2323
executor.map(download_site, sites)
2424

2525

0 commit comments

Comments
 (0)