Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
void threadSync ()
 Synchronizes the threads in the group.
 

Private Attributes

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

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 49 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 59 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 69 of file Barrier.h.

Member Data Documentation

◆ m_allThreadsReachedSync

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

Definition at line 50 of file Barrier.h.

◆ m_numThreadsReachedSync

uint32_t ogdf::Barrier::m_numThreadsReachedSync
private

number of htreads that reached current synchronization point.

Definition at line 54 of file Barrier.h.

◆ m_numThreadsReachedSyncLock

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

Definition at line 51 of file Barrier.h.

◆ m_syncNumber

uint32_t ogdf::Barrier::m_syncNumber
private

number of current synchronization point.

Definition at line 55 of file Barrier.h.

◆ m_threadCount

uint32_t ogdf::Barrier::m_threadCount
private

the number of threads in the group.

Definition at line 53 of file Barrier.h.


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