From 8ff5e5b0ab6002922d8d9b523b1b50fb5cf80b9a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 27 Apr 2024 01:12:11 -0400 Subject: [PATCH] Fix lychee for guide (#4130) * Fix lychee for guide * Update nightly in netlify --- .netlify/build.sh | 1 + guide/src/parallelism.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.netlify/build.sh b/.netlify/build.sh index e1d86788..a61180be 100755 --- a/.netlify/build.sh +++ b/.netlify/build.sh @@ -2,6 +2,7 @@ set -uex +rustup update nightly rustup default nightly PYO3_VERSION=$(cargo search pyo3 --limit 1 | head -1 | tr -s ' ' | cut -d ' ' -f 3 | tr -d '"') diff --git a/guide/src/parallelism.md b/guide/src/parallelism.md index 792e0ed8..a288b14b 100644 --- a/guide/src/parallelism.md +++ b/guide/src/parallelism.md @@ -1,6 +1,6 @@ # Parallelism -CPython has the infamous [Global Interpreter Lock](https://docs.python.org/3/glossary.html#term-global-interpreter-lock), which prevents several threads from executing Python bytecode in parallel. This makes threading in Python a bad fit for [CPU-bound](https://stackoverflow.com/questions/868568/) tasks and often forces developers to accept the overhead of multiprocessing. +CPython has the infamous [Global Interpreter Lock](https://docs.python.org/3/glossary.html#term-global-interpreter-lock), which prevents several threads from executing Python bytecode in parallel. This makes threading in Python a bad fit for [CPU-bound](https://en.wikipedia.org/wiki/CPU-bound) tasks and often forces developers to accept the overhead of multiprocessing. In PyO3 parallelism can be easily achieved in Rust-only code. Let's take a look at our [word-count](https://github.com/PyO3/pyo3/blob/main/examples/word-count/src/lib.rs) example, where we have a `search` function that utilizes the [rayon](https://github.com/rayon-rs/rayon) crate to count words in parallel. ```rust,no_run