Skip to content

Commit

Permalink
docs: grammar fixes for free-threaded guide (#4805)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum authored Dec 18, 2024
1 parent b17de4f commit c869e51
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions guide/src/free-threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ mutability](./class.md#bound-and-interior-mutability),) but now in free-threaded
Python there are more opportunities to trigger these panics from Python because
there is no GIL to lock concurrent access to mutably borrowed data from Python.

The most straightforward way to trigger this problem to use the Python
The most straightforward way to trigger this problem is to use the Python
[`threading`] module to simultaneously call a rust function that mutably borrows a
[`pyclass`]({{#PYO3_DOCS_URL}}/pyo3/attr.pyclass.html). For example,
consider the following implementation:
[`pyclass`]({{#PYO3_DOCS_URL}}/pyo3/attr.pyclass.html) in multiple threads. For
example, consider the following implementation:

```rust
# use pyo3::prelude::*;
Expand Down Expand Up @@ -240,7 +240,7 @@ RuntimeError: Already borrowed
We plan to allow user-selectable semantics for mutable pyclass definitions in
PyO3 0.24, allowing some form of opt-in locking to emulate the GIL if that is
needed. For now you should explicitly add locking, possibly using conditional
compilation or using the critical section API to avoid creating deadlocks with
compilation or using the critical section API, to avoid creating deadlocks with
the GIL.

### Cannot build extensions using the limited API
Expand All @@ -252,8 +252,8 @@ PyO3 will print a warning and ignore that setting when building extensions using
the free-threaded interpreter.

This means that if your package makes use of the ABI forward compatibility
provided by the limited API to uploads only one wheel for each release of your
package, you will need to update and tooling or instructions to also upload a
provided by the limited API to upload only one wheel for each release of your
package, you will need to update your release procedure to also upload a
version-specific free-threaded wheel.

See [the guide section](./building-and-distribution/multiple-python-versions.md)
Expand Down

0 comments on commit c869e51

Please sign in to comment.