Skip to content

Commit 8c7bbcb

Browse files
Merge pull request #113 from rodrirejala/fix/cpu-work-overflow-111
fix(python-book): prevent u64 overflow in cpu_work threading example
2 parents 19510c1 + 6a26b3b commit 8c7bbcb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python-book/src/ch01-introduction-and-motivation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn cpu_work(n: u64) -> u64 {
265265
fn main() {
266266
let start = std::time::Instant::now();
267267
let handles: Vec<_> = (0..4)
268-
.map(|_| thread::spawn(|| cpu_work(10_000_000)))
268+
.map(|_| thread::spawn(|| cpu_work(3_000_000)))
269269
.collect();
270270

271271
let results: Vec<u64> = handles.into_iter()

0 commit comments

Comments
 (0)