Couchbase C Client
3.3.14
Asynchronous C Client for Couchbase
|
This library is not designed to be thread-safe. However, it should be safe to use one lcb_INSTANCE
object per thread, with some caveats and careful consideration.
lcb_INSTANCE
is not shared with other threads. For performance, there are no internal locks or other thread safety mechanisms to protect internal data structures.lcb_INSTANCE
. Therefore, a multi-threaded application must also override the logger with a thread-safe version or use a separate logger for each instance (see example example/threads-private/threads-private.c).lcb_io_opt_t
) must also be protected in a similar manner. Such instances must either be protected and made thread-safe internally or a new instance per lcb_INSTANCE
can be provided.As with any multi-threaded application extra testing and analysis should be done using a tool like Valgrind/DRD, ThreadSanitizer or similar.
lcb_INSTANCE
when it is shared between multiple threads.lcb_INSTANCE
to each thread, and how to use custom logger in the thread-safe way.