Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::Barrier Class Reference

Representation of a barrier. More...

#include <ogdf/basic/Barrier.h>

Public Member Functions

 Barrier (uint32_t numThreads)
 Creates a barrier for a group of numThreads threads. More...
 
void threadSync ()
 Synchronizes the threads in the group. More...
 

Private Attributes

std::condition_variable m_allThreadsReachedSync
 
uint32_t m_numThreadsReachedSync
 number of htreads that reached current synchronization point. More...
 
std::mutex m_numThreadsReachedSyncLock
 
uint32_t m_syncNumber
 number of current synchronization point. More...
 
uint32_t m_threadCount
 the number of threads in the group. More...
 

Detailed Description

Representation of a barrier.

A barrier is used for synchronizing threads. A barrier for a group of threads means that all threads in the group must have reached the barrier before any of the threads may proceed executing code after the barrier.

Definition at line 50 of file Barrier.h.

Constructor & Destructor Documentation

◆ Barrier()

ogdf::Barrier::Barrier ( uint32_t  numThreads)
inlineexplicit

Creates a barrier for a group of numThreads threads.

Definition at line 62 of file Barrier.h.

Member Function Documentation

◆ threadSync()

void ogdf::Barrier::threadSync ( )
inline

Synchronizes the threads in the group.

Each thread proceeds only after all threads in the group have reached the barrier. A barrier may be used for several synchronization points.

Definition at line 72 of file Barrier.h.

Member Data Documentation

◆ m_allThreadsReachedSync

std::condition_variable ogdf::Barrier::m_allThreadsReachedSync
private

Definition at line 52 of file Barrier.h.

◆ m_numThreadsReachedSync

uint32_t ogdf::Barrier::m_numThreadsReachedSync
private

number of htreads that reached current synchronization point.

Definition at line 56 of file Barrier.h.

◆ m_numThreadsReachedSyncLock

std::mutex ogdf::Barrier::m_numThreadsReachedSyncLock
private

Definition at line 53 of file Barrier.h.

◆ m_syncNumber

uint32_t ogdf::Barrier::m_syncNumber
private

number of current synchronization point.

Definition at line 57 of file Barrier.h.

◆ m_threadCount

uint32_t ogdf::Barrier::m_threadCount
private

the number of threads in the group.

Definition at line 55 of file Barrier.h.


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