#include <infiniband/verbs.h> struct ibv_td *ibv_alloc_td(struct ibv_context *context, struct ibv_td_init_attr *init_attr); int ibv_dealloc_td(struct ibv_td *td);
The thread domain object defines how the verbs libraries and provider will use locks and additional hardware capabilities to achieve best performance for handling multi-thread or single-thread protection. An application assigns verbs resources to a thread domain when it creates a verbs object.
If the ibv_td object is specified then any objects created under this thread domain will disable internal locking designed to protect against concurrent access to that object from multiple user threads. By default all verbs objects are safe for multi-threaded access, whether or not a thread domain is specified.
A struct ibv_td can be added to a parent domain via ibv_alloc_parent_domain() and then the parent domain can be used to create verbs objects.