Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concurrency-overview/io_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def download_all_sites(sites):

if __name__ == "__main__":
sites = [
"http://www.jython.org",
"https://www.jython.org",
"http://olympus.realpython.org/dice",
] * 80
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion concurrency-overview/io_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def download_all_sites(sites):

if __name__ == "__main__":
sites = [
"http://www.jython.org",
"https://www.jython.org",
"http://olympus.realpython.org/dice",
] * 80
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion concurrency-overview/io_non_concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def download_all_sites(sites):

if __name__ == "__main__":
sites = [
"http://www.jython.org",
"https://www.jython.org",
"http://olympus.realpython.org/dice",
] * 80
start_time = time.time()
Expand Down
2 changes: 1 addition & 1 deletion concurrency-overview/io_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def download_all_sites(sites):

if __name__ == "__main__":
sites = [
"http://www.jython.org",
"https://www.jython.org",
"http://olympus.realpython.org/dice",
] * 80
start_time = time.time()
Expand Down
6 changes: 3 additions & 3 deletions intro-to-threading/prodcom_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import random
import threading

SENTINEL = -1
SENTINEL = object()


class Pipeline:
Expand Down Expand Up @@ -51,9 +51,9 @@ def producer(pipeline):
def consumer(pipeline):
""" Pretend we're saving a number in the database. """
message = 0
while message != SENTINEL:
while message is not SENTINEL:
message = pipeline.get_message("Consumer")
if message != SENTINEL:
if message is not SENTINEL:
logging.info("Consumer storing message: %s", message)


Expand Down