Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Single policy class defining an approach for sharing an integral object across threads as well as a general heavy-weight locking policy. More...
#include <Teuchos_SharedAccessPolicy.hpp>
Public Types | |
typedef ThreadLock | lock_type |
typedef ScopedThreadLock | scoped_lock_type |
typedef int | atomic_integral_type |
Supported type for shared integral objects. More... | |
Static Public Member Functions | |
static void | atomic_set (atomic_integral_type *p, const atomic_integral_type v) |
Atomic setting a shared integral object. More... | |
static const atomic_integral_type | atomic_fetch (const atomic_integral_type *p) |
Atomic fetch a shared integral object. More... | |
static void | atomic_increment (atomic_integral_type *p) |
Atomic increment of a shared integral object. More... | |
static void | atomic_decrement (atomic_integral_type *p) |
Atomic decrement of a shared integral object. More... | |
Single policy class defining an approach for sharing an integral object across threads as well as a general heavy-weight locking policy.
This policy class provides an primative integral type (atomic_integral_type) and a set of atomic primitives for incrementing/decrementing and/or setting/fetching the object.
This policy class also provides typdefs for generic heavier-weight thread locking objects that can be used for more general locking.
This class is designed, in purpose, to provide sufficient functionality to make the Teuchos MM classes thread-safe. However, the will have other uses in Teuchos and other C++ code also.
There will likely be a typedef called DefaultSharedAccessPolicy in the Teuchos namespace that will select the default global policy (i.e. the one used by the Teuchos MM classes by default). Also, there well as concrete implementations NonthreadedSharedAccessPolicy, TbbSharedAccessPolicy, PtheadsSharedAccessPolicy, and others (when support is enabled).
Definition at line 86 of file Teuchos_SharedAccessPolicy.hpp.
Definition at line 89 of file Teuchos_SharedAccessPolicy.hpp.
Definition at line 91 of file Teuchos_SharedAccessPolicy.hpp.
Supported type for shared integral objects.
Definition at line 93 of file Teuchos_SharedAccessPolicy.hpp.
|
inlinestatic |
Atomic setting a shared integral object.
|
inlinestatic |
Atomic fetch a shared integral object.
|
inlinestatic |
Atomic increment of a shared integral object.
|
inlinestatic |
Atomic decrement of a shared integral object.