Skip to content

Commit 84c1fe5

Browse files
authored
Merge pull request #41 from realpython/jima/threading_fixup
Jima/threading fixup
2 parents 21f6077 + 5c89452 commit 84c1fe5

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

concurrency-overview/io_asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def download_all_sites(sites):
2020

2121
if __name__ == "__main__":
2222
sites = [
23-
"http://www.jython.org",
23+
"https://www.jython.org",
2424
"http://olympus.realpython.org/dice",
2525
] * 80
2626
start_time = time.time()

concurrency-overview/io_mp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def download_all_sites(sites):
2525

2626
if __name__ == "__main__":
2727
sites = [
28-
"http://www.jython.org",
28+
"https://www.jython.org",
2929
"http://olympus.realpython.org/dice",
3030
] * 80
3131
start_time = time.time()

concurrency-overview/io_non_concurrent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def download_all_sites(sites):
1616

1717
if __name__ == "__main__":
1818
sites = [
19-
"http://www.jython.org",
19+
"https://www.jython.org",
2020
"http://olympus.realpython.org/dice",
2121
] * 80
2222
start_time = time.time()

concurrency-overview/io_threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def download_all_sites(sites):
2727

2828
if __name__ == "__main__":
2929
sites = [
30-
"http://www.jython.org",
30+
"https://www.jython.org",
3131
"http://olympus.realpython.org/dice",
3232
] * 80
3333
start_time = time.time()

intro-to-threading/prodcom_lock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import random
55
import threading
66

7-
SENTINEL = -1
7+
SENTINEL = object()
88

99

1010
class Pipeline:
@@ -51,9 +51,9 @@ def producer(pipeline):
5151
def consumer(pipeline):
5252
""" Pretend we're saving a number in the database. """
5353
message = 0
54-
while message != SENTINEL:
54+
while message is not SENTINEL:
5555
message = pipeline.get_message("Consumer")
56-
if message != SENTINEL:
56+
if message is not SENTINEL:
5757
logging.info("Consumer storing message: %s", message)
5858

5959

0 commit comments

Comments
 (0)