ulib/3party/sqlpp11/docs/Threads.md
tqcq 9ec8eb952e
All checks were successful
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m11s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m22s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m27s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m29s
linux-x64-gcc / linux-gcc (push) Successful in 1m55s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 3m17s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (pull_request) Successful in 1m9s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (pull_request) Successful in 1m14s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (pull_request) Successful in 1m20s
linux-x64-gcc / linux-gcc (pull_request) Successful in 1m24s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 4m26s
linux-mips64-gcc / linux-gcc-mips64el (pull_request) Successful in 1m43s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (pull_request) Successful in 1m55s
linux-hisiv500-gcc / linux-gcc-hisiv500 (pull_request) Successful in 4m8s
fix use mirror repository of date
2024-01-06 21:51:10 +08:00

20 lines
988 B
Markdown

# Thread Safety
sqlpp11 aspires to have no influence on thread safety itself, but offers
no particular guarantees (PRs welcome). This means that in the general case
your program may have problems if it does one of the following
* Creates a connection in one thread and then uses it in another thread..
* Uses the same connection simultaneously in multiple threads.
The exact level of thread-safety depends on the underlying client library, for
example with MySQL, PostgreSQL and SQLite3 it is generally safe to create a
connection in one thread and then use it in another thread, but attempting to
use the same connection simultaneously in multiple threads causes crashes,
lock-ups and SQL errors.
The recommendation therefore is to **not share** connections between threads
and to read about thread safety of the underlying database for more
information. You may also look into [Connection Pools](Connection-Pools.md)
as a way to make SQL queries simultaneously in multiple threads.