Thread Safety#

Most SDK functions are thread safe, with the following important exceptions:

  • SDK Initialization and Shutdown: Functions that initialize or shut down the SDK are not thread safe. These should only be called from a single thread, and no other SDK functions should be called concurrently during initialization or shutdown.

  • Handle-Mutating Functions: Functions that create, destroy, or modify handles (such as setters, create, or free functions) are not thread safe with respect to the same handle. Do not call these functions concurrently on the same handle from multiple threads.

Handle Usage in Multithreaded Environments#

  • Handles (the first argument to most SDK functions) may be safely shared between threads as long as only thread-safe functions are called, and no thread is concurrently mutating the handle (creating, destroying, or modifying it).

  • If a function or handle has different thread safety guarantees, this will be explicitly documented in the API reference.

Shared State#

Some SDK objects (such as those created with nvat_ocsp_client_create_default()) may contain state to implement caching or HTTP connection pooling. For best performance in multithreaded applications, share these handles across threads rather than creating a new instance per thread.

If you are unsure about the thread safety of a particular function or handle, consult the API documentation or contact the SDK maintainers.