Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | List of all members
Teuchos::SharedAccessPolicy Class Reference

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...
 

Detailed Description

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.

Member Typedef Documentation

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.

Member Function Documentation

static void Teuchos::SharedAccessPolicy::atomic_set ( atomic_integral_type p,
const atomic_integral_type  v 
)
inlinestatic

Atomic setting a shared integral object.

static const atomic_integral_type Teuchos::SharedAccessPolicy::atomic_fetch ( const atomic_integral_type p)
inlinestatic

Atomic fetch a shared integral object.

static void Teuchos::SharedAccessPolicy::atomic_increment ( atomic_integral_type p)
inlinestatic

Atomic increment of a shared integral object.

static void Teuchos::SharedAccessPolicy::atomic_decrement ( atomic_integral_type p)
inlinestatic

Atomic decrement of a shared integral object.


The documentation for this class was generated from the following file: