Skip to content

Commit 2aa4264

Browse files
committed
add documentation regarding thread safety
1 parent a96a6e9 commit 2aa4264

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/reference/Thread-Safety.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Thread safety
2+
3+
Object instances of pyosmium are not thread-safe to modify. If you share
4+
objects like an index, you have to protect write accesses to these objects.
5+
Concurrent reads are safe.
6+
7+
The library functions themselves are all reentrant and may be used safely from
8+
different threads.
9+
10+
### Free-threaded Python
11+
12+
Starting with version 4.1, Pyosmium has experimental support for Python
13+
runtimes with GIL disabled. See the
14+
[Python Free-Threading Guide](https://py-free-threading.github.io/)
15+
for more information.
16+
17+
The restrictions mentioned above still apply: write accesses on object need
18+
to be protected by exclusive locks when using them in multi-threaded context.

mkdocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ nav:
4747
- Indexes: 'reference/Indexes.md'
4848
- Replication: 'reference/Replication.md'
4949
- Exceptions: 'reference/Exceptions.md'
50+
- Thread Safety: 'reference/Thread-Safety.md'
5051

5152
exclude_docs: |
5253
.*.swp

0 commit comments

Comments
 (0)