TMB Documentation
v1.9.11
|
Manage shared operator data across multiple threads. More...
#include <checkpoint.hpp>
Manage shared operator data across multiple threads.
An operator that shares a resource using the normal std::shared_ptr
can be made thread safe by simply replacing 'shared_ptr' by 'omp_shared_ptr'. Thread safety is guarantied in the following two situations:
omp_shared_ptr
.Each instance has an extra pointer to a 'book-keeping' structure, essentially doubling its size compared to the normal shared_ptr. Operator copy is still a fairly quick operation involving essentially two reference counter increments.
The resource sharing has the following properties:
Definition at line 95 of file checkpoint.hpp.