|
C3D Toolkit
Kernel - 118056, Vision - 2.14.6.1819
|
Locks implementation on base of system synchronization mechanisms and OpenMP locks. details Implementation of locks (including scoped lock) on base of system synchronization mechanisms and OpenMP locks.
.
More...
#include <math_define.h>Classes | |
| class | CommonMutex |
| Lock class. More... | |
| class | ParallelRegionGuard |
| Scoped guard of parallel region. More... | |
| class | ScopedLock |
| Scoped lock. Can accept a null pointer to a mutex. Locking occurs if the pointer to the mutex is nonzero and the code runs in parallel. More... | |
| class | ScopedRecursiveLock |
| Recursive scoped lock. Can accept a null pointer to a mutex. Locking occurs if the pointer to the mutex is nonzero and the code runs in parallel. More... | |
| class | MbSyncItem |
| Base synchronization object with lazy initialization. More... | |
| class | MbNestSyncItem |
| Base synchronization object with lazy initialization which supports nested locks. More... | |
| class | MbPersistentSyncItem |
| Base object providing means of synchronization. More... | |
| class | MbPersistentNestSyncItem |
| Base synchronization object with support of nested locks. More... | |
Macros | |
| #define | CommonRecursiveMutex CommonMutex |
| Same implementation of CommonMutex and CommonRecursiveMutex. | |
| #define | ENTER_PARALLEL(useParallel) if ( useParallel ) EnterParallelRegion(); |
| If useParallel == true, notifies the kernel about entering a parallel region. More... | |
| #define | EXIT_PARALLEL(useParallel) if ( useParallel ) ExitParallelRegion(); |
| If useParallel == true, notifies the kernel about exiting a parallel region. More... | |
| #define | ENTER_PARALLEL_FORCED EnterParallelRegion(); |
| Notifies the kernel about entering a parallel region. More... | |
| #define | EXIT_PARALLEL_FORCED ExitParallelRegion(); |
| Notifies the kernel about exiting a parallel region. More... | |
| #define | SET_MEMORY_SCOPED_LOCK ScopedRecursiveLock memScopedLock( GetGlobalRecursiveLock() ); |
| Set scoped lock for memory allocation and deallocation operations. | |
Enumerations | |
| enum | MbeMultithreadedMode { mtm_Off = 0 , mtm_Standard = 1 , mtm_SafeItems = 2 , mtm_Items = 3 , mtm_Max = 31 } |
| Multithreading modes. More... | |
Functions | |
| void | EnterParallelRegion () |
| The function notifies the kernel about entering a parallel region. The function call should be placed before the start of a parallel block. | |
| void | ExitParallelRegion () |
| The function notifies the kernel about exiting a parallel region. The function call should be placed after the end of the parallel block. | |
| bool | IsInParallel () |
| The function determines whether the code is executed in parallel. | |
| bool | CacheCleanupAllowed () |
| The function determines whether the caches cleanup is allowed. | |
| bool | IsSafeMultithreading () |
| Whether is enabled a safe multithreading mode (used in CacheManager). | |
| bool | LocksEnabled () |
| Whether locks are enabled (multithreading is on and code is executed in parallel). | |
| unsigned int | GetThreadKey () |
| Get a current thread pseudo-identifier. | |
| CommonMutex * | GetGlobalLock () |
| Get a pointer to the global mutex (used in CacheManager). | |
| CommonMutex * | GetGlobalRecursiveLock () |
| Get a pointer to the global recursive mutex (used for memory allocation and deallocation operations). | |
Locks implementation on base of system synchronization mechanisms and OpenMP locks. details Implementation of locks (including scoped lock) on base of system synchronization mechanisms and OpenMP locks.
.
| #define ENTER_PARALLEL | ( | useParallel | ) | if ( useParallel ) EnterParallelRegion(); |
If useParallel == true, notifies the kernel about entering a parallel region.
If useParallel == true, notifies the kernel about entering a parallel region. The call should be placed before the start of a parallel block (before OpenMP pragma). Using a macro speeds up parallel OpenMP cycles significantly.
| #define EXIT_PARALLEL | ( | useParallel | ) | if ( useParallel ) ExitParallelRegion(); |
If useParallel == true, notifies the kernel about exiting a parallel region.
If useParallel == true, notifies the kernel about exiting a parallel region. The call should be placed after the end of the parallel block. Using a macro speeds up parallel OpenMP cycles significantly.
| #define ENTER_PARALLEL_FORCED EnterParallelRegion(); |
Notifies the kernel about entering a parallel region.
Notifies the kernel about entering a parallel region. The call should be placed before the start of a parallel block (before OpenMP pragma). Using a macro speeds up parallel OpenMP cycles significantly.
| #define EXIT_PARALLEL_FORCED ExitParallelRegion(); |
Notifies the kernel about exiting a parallel region.
Notifies the kernel about exiting a parallel region. The call should be placed after the end of the parallel block. Using a macro speeds up parallel OpenMP cycles significantly.