Using SQLite In Multi-Threaded Applications
(threadsafe.html)
1. Overview
SQLite supports three different threading modes:
Single-thread.
In this mode, all mutexes are disabled and SQLite is unsafe to use in
more than a single thread at once.
Multi-thread.
In this mode, SQLite can be safely used by ...
|
C API: Retrieve the mutex for a database connection
(c3ref/db_mutex.html)
sqlite3_db_mutex()
This interface returns a pointer the sqlite3_mutex object that
serializes access to the database connection given in the argument
when the threading mode is Serialized.
If the threading mode is Single-thread or Multi-thread then this
routine returns a ...
|
C API: Mutexes
(c3ref/mutex_alloc.html)
sqlite3_mutex_alloc(), sqlite3_mutex_free(), sqlite3_mutex_enter(), sqlite3_mutex_try(), sqlite3_mutex_leave()
The SQLite core uses these routines for thread
synchronization. Though they are intended for internal
use by SQLite, code that links against SQLite is
permitted to use any of these routines.
The SQLite source code contains multiple implementations
of these ...
|
SQLite Unlock-Notify API
(unlock_notify.html)
... If each thread were assigned a priority, then instead of just
signaling the threads in arbitrary order as this implementation does,
higher priority threads could be signaled before lower priority threads.
If a "DROP TABLE" or "DROP INDEX" SQL command ...
|
C API: Test To See If The Library Is Threadsafe
(c3ref/threadsafe.html)
sqlite3_threadsafe()
... Without the mutexes, it is not safe
to use SQLite concurrently from more than one thread.
Enabling mutexes incurs a measurable performance penalty.
So if speed is of utmost importance, it makes sense to disable
the mutexes. But for maximum ...
|
Custom Builds Of SQLite
(custombuild.html)
... The mutex subsystem is only required for applications that access
SQLite from multiple threads. For single-threaded applications, or
applications which only call SQLite from a single thread, the mutex
subsystem can be completely disabled by recompiling with the following ...
|
C API: Configuration Options
(c3ref/c_config_covering_index_scan.html)
SQLITE_CONFIG_SINGLETHREAD, SQLITE_CONFIG_MULTITHREAD, SQLITE_CONFIG_SERIALIZED, SQLITE_CONFIG_MALLOC, SQLITE_CONFIG_GETMALLOC, SQLITE_CONFIG_SCRATCH ...
... This option sets the
threading mode to Single-thread. In other words, it disables
all mutexing and puts SQLite into a mode where it can only be used
by a single thread. If SQLite is compiled with
the SQLITE_THREADSAFE=0 ...
|
C API: Return The Schema Name For A Database Connection
(c3ref/db_name.html)
sqlite3_db_name()
... The string might be deallocated by any operation that
changes the schema, including ATTACH or DETACH or calls to
sqlite3_serialize() or sqlite3_deserialize(), even operations that
occur on a different thread. Applications that need to
remember the string long-term should ...
|
SQLite Changes From Version 3.4.2 To 3.5.0
(34to35.html)
... The sqlite3_enable_shared_cache() interface now applies to all
threads within a process, not to just the one thread in which it
was run.
The sqlite3_soft_heap_limit() interface now applies to all threads
within a process, not to just the one thread in ...
|
An Asynchronous I/O Module For SQLite
(asyncvfs.html)
... 1.0 FUNCTIONALITY
With asynchronous I/O, write requests are handled by a separate thread
running in the background. This means that the thread that initiates
a database write does not have to wait for (sometimes slow) disk I/O ...
|
Page generated by FTS5 in about 76.52 ms.