File: Thread-Safety.md

package info (click to toggle)
pyosmium 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,600 kB
  • sloc: python: 4,493; cpp: 2,616; makefile: 21
file content (18 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Thread safety

Object instances of pyosmium are not thread-safe to modify. If you share
objects like an index, you have to protect write accesses to these objects.
Concurrent reads are safe.

The library functions themselves are all reentrant and may be used safely from
different threads.

### Free-threaded Python

Starting with version 4.1, Pyosmium has experimental support for Python
runtimes with GIL disabled. See the
[Python Free-Threading Guide](https://py-free-threading.github.io/)
for more information.

The restrictions mentioned above still apply: write accesses on object need
to be protected by exclusive locks when using them in multi-threaded context.