ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::OpenMPLock Class Reference

the lock of OpenMP, omp_lock_t, as a mutex of the standard More...

#include <ADS/parallel/OpenMPExecutor.h>

Public member functions

 OpenMPLock (void)
 an unlocked lock; on the runtime of LLVM a test-and-set one, since its default lock queues the threads and hands over in their order, so that with more threads than cores the next one is often descheduled and the others wait behind it (libgomp ignores the hint)
 OpenMPLock (const OpenMPLock &)=delete
 no copy, as a mutex
OpenMPLock & operator= (const OpenMPLock &)=delete
 no copy, as a mutex
 ~OpenMPLock ()
 destroys the lock, which nobody holds
void lock (void)
 takes the lock, waiting for it
void unlock (void)
 gives the lock back
bool try_lock (void)
 takes the lock if it is free, and tells whether it did

Detailed description

the lock of OpenMP, omp_lock_t, as a mutex of the standard

Constructor and destructor documentation

◆ OpenMPLock() [1/2]

ADS::OpenMPLock::OpenMPLock ( void )
inline

an unlocked lock; on the runtime of LLVM a test-and-set one, since its default lock queues the threads and hands over in their order, so that with more threads than cores the next one is often descheduled and the others wait behind it (libgomp ignores the hint)

◆ OpenMPLock() [2/2]

ADS::OpenMPLock::OpenMPLock ( const OpenMPLock & )
delete

no copy, as a mutex

◆ ~OpenMPLock()

ADS::OpenMPLock::~OpenMPLock ( )
inline

destroys the lock, which nobody holds

Member function documentation

◆ lock()

void ADS::OpenMPLock::lock ( void )
inline

takes the lock, waiting for it

◆ operator=()

OpenMPLock & ADS::OpenMPLock::operator= ( const OpenMPLock & )
delete

no copy, as a mutex

◆ try_lock()

bool ADS::OpenMPLock::try_lock ( void )
inline

takes the lock if it is free, and tells whether it did

◆ unlock()

void ADS::OpenMPLock::unlock ( void )
inline

gives the lock back


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