Table of Contents


qthread_feb_barrier_create, qthread_feb_barrier_enter, qthread_feb_barrier_destroy, qthread_feb_barrier_resize - manipulates FEB-based barriers


#include <qthread/feb_barrier.h>

qt_feb_barrier_t *
qthread_feb_barrier_create (size_t max_threads);

qthread_feb_barrier_enter (qt_feb_barrier_t *b);

qthread_feb_barrier_resize (size_tnew_max_threads);

qthread_feb_barrier_destroy (qt_feb_barrier_t *b);


These are the functions for manipulating simplistic FEB-based barriers.

The qthread_feb_barrier_create() function generates a barrier data structure, which can then be used to wait for max_threads threads to enter the barrier. To enter the barrier, each thread must call qthread_feb_barrier_enter(), which will cause the thread to block until the specified number of threads has entered the same barrier. Once the barrier is no longer needed, it can be deallocated with the qthread_feb_barrier_destroy() function. Instead of destroying and creating a new barrier, barriers may be resized if necessary, using the qthread_feb_barrier_resize() function. The barrier must be empty before resizing.

Table of Contents