Platform-independent multithreading support. More...
Classes | |
| struct | PLMD::thread_mpi::tMPI_Thread_barrier_t |
| Pthread implementation of barrier type. More... | |
| struct | PLMD::thread_mpi::tMPI_Thread_cond_t |
| Condition variable handle for threads. More... | |
| struct | PLMD::thread_mpi::tMPI_Thread_key_t |
| Pthread implementation of the abstract tMPI_Thread_key type. More... | |
| struct | PLMD::thread_mpi::tMPI_Thread_mutex_t |
| Opaque mutex datatype. More... | |
| struct | PLMD::thread_mpi::tMPI_Thread_once_t |
| One-time initialization data for thread. More... | |
Namespaces | |
| namespace | PLMD |
| Fast (possibly busy-wait-based) barrier type. | |
| namespace | PLMD::thread_mpi |
Macros | |
| #define | TMPI_FARGS __FILE__, __LINE__ |
| Convenience macro for the first two arguments to tMPI_Fatal_error(). | |
| #define | TMPI_THREAD_BARRIER_INITIALIZER(count) |
| Static initializer for tMPI_Thread_barrier_t. | |
| #define | TMPI_THREAD_COND_INITIALIZER { {0}, NULL} |
| Static initializer for tMPI_Thread_cond_t. | |
| #define | TMPI_THREAD_MUTEX_INITIALIZER { {0}, NULL } |
| Static initializer for tMPI_Thread_mutex_t. | |
| #define | TMPI_THREAD_ONCE_INIT { {0} } |
| Static initializer for tMPI_Thread_once_t. | |
Typedefs | |
| typedef struct tMPI_Thread * | PLMD::thread_mpi::tMPI_Thread_t |
Platform-independent multithreading support.
This file provides an portable thread interface very similar to POSIX threads, as a thin wrapper around the threads provided operating system (whether they be POSIX threads or something else).
In other words, while the naming conventions are very similar to pthreads, you should NOT assume that a thread_mpi thread type (thread,mutex,key, etc) is the same as the Pthreads equivalent, even on platforms where we are using pthreads.
Because the synchronization functions here are similar to the basic mutexes/conditions/barriers provided by the operating system, performance will most likely be worse than when using the atomic synchronization functions of atomic.h. On the other hand, because the operating system can schedule out waiting threads using these functions, they are the appropriate ones for I/O and initialization.
Since this module is merely intended to be a transparent wrapper around a system-dependent thread implementation, we simply echo errors to stderr. The user should check the return codes] and take appropriate action when using these functions (fat chance, but errors are rare).
| #define TMPI_FARGS __FILE__, __LINE__ |
Convenience macro for the first two arguments to tMPI_Fatal_error().
| #define TMPI_THREAD_BARRIER_INITIALIZER | ( | count | ) |
Static initializer for tMPI_Thread_barrier_t.
See the description of the tMPI_Thread_barrier_t datatype for instructions on how to use this. Note that variables initialized with this value MUST have static storage allocation.
| count | Threshold for barrier |
| #define TMPI_THREAD_COND_INITIALIZER { {0}, NULL} |
Static initializer for tMPI_Thread_cond_t.
See the description of the tMPI_Thread_cond_t datatype for instructions on how to use this. Note that any variables initialized with this value MUST have static storage allocation.
| #define TMPI_THREAD_MUTEX_INITIALIZER { {0}, NULL } |
Static initializer for tMPI_Thread_mutex_t.
See the description of the tMPI_Thread_mutex_t datatype for instructions on how to use this. Note that any variables initialized with this value MUST have static storage allocation.
| #define TMPI_THREAD_ONCE_INIT { {0} } |
Static initializer for tMPI_Thread_once_t.
See the description of the tMPI_Thread_once_t datatype for instructions on how to use this. Normally, all variables of that type should be initialized statically to this value.
Hosted by GitHub
|
1.13.2
|