Grokking Concurrency in Python
Vote

0% completed

​

Measuring the Gain and the Cost

If one thread needs 0.40 seconds for a job, 16 threads that share the work perfectly would need 0.40 / 16 = 0.025 seconds. No real program reaches that figure, and the distance to it is the first number a move to the free-threaded build needs.

Two more numbers complete the decision: the extra time the free-threaded build costs a program with one thread, and the time lost when threads share one object instead of keeping their own. All three are measured below on Harvest's indexer, on both builds.

How the Measurements Were Made

`jobs.py

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content