Skip to content

Commit 971b48f

Browse files
davidhewittkngwyu
andauthored
Update guide/src/parallelism.md
Co-authored-by: Yuji Kanagawa <[email protected]>
1 parent 4d2913d commit 971b48f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guide/src/parallelism.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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.
44

5-
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/nikomatsakis/rayon) crate to count words in parallel.
5+
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.
66
```rust, ignore
77
#[pyfunction]
88
fn search(contents: &str, needle: &str) -> usize {

0 commit comments

Comments
 (0)