qthread_feb_barrier(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

πŸ’– qthread_feb_barrier β€” the libqthread girlies ✨

ok so this page is qthread_feb_barrier(3), part of the libqthread manual, and it's all about FEB-based barriers. no cap, let's get into it 🫢


🌸 NAME 🌸

qthread_feb_barrier_create, qthread_feb_barrier_enter, qthread_feb_barrier_destroy, qthread_feb_barrier_resize β€” manipulates FEB-based barriers πŸ’…


✨ SYNOPSIS ✨

#include <qthread/feb_barrier.h>

qt_feb_barrier_t *
qthread_feb_barrier_create (size_t max_threads);

void
qthread_feb_barrier_enter (qt_feb_barrier_t *b);

void
qthread_feb_barrier_resize (size_tnew_max_threads);

void
qthread_feb_barrier_destroy (qt_feb_barrier_t *b);
bestie. yes. size_tnew_max_threads really do be written like that. no space. we don't fix it, we respect it. iykyk πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

These are the functions for manipulating simplistic FEB-based barriers. lowkey iconic, highkey useful πŸ’œ

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. it's giving "hold up, everybody get here first" energy, fr fr.

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. so like, your thread just sits there, main character waiting at the door, until the whole squad has arrived πŸŽ€

Once the barrier is no longer needed, it can be deallocated with the qthread_feb_barrier_destroy() function. say bye, slay, gone ✨

Instead of destroying and creating a new barrier, barriers may be resized if necessary, using the qthread_feb_barrier_resize() function. glow-up instead of a whole new you, we love to see it πŸ’…

⚠️ the barrier must be empty before resizing. that's not a vibe suggestion bestie, that's the rule. don't resize a barrier with threads still in it. periodt. πŸ’€

🌈 SEE ALSO 🌈

hmm wait, the page didn't actually have a SEE ALSO section β€” that's just me being extra. the real sections were NAME, SYNOPSIS, and DESCRIPTION, and we did them all, bestie 🫢


ok and for the cute sign-off: this one's from libqthread, dated APRIL 2011, and it's page qthread_feb_barrier(3). vintage but still ate. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from