qthread_readFE(3)
π qthread_readFE β from the libqthread girlies π
okay so bestie, this is a page from libqthread, and today's main character is qthread_readFE(3). she waits for your source to be full, then copies it and empties it. it's giving β¨ the classic read-and-empty β¨ and honestly? iconic.
β¨ NAME β¨
qthread_readFE β waits for the source to be full, then copies it and empties it π«Ά
πΈ SYNOPSIS πΈ
#include <qthread.h>
int
qthread_readFE (aligned_t *dest, const aligned_t *src);
π¦ DESCRIPTION π¦
so basically, this function waits for memory to become full, and then it empties it. the way it works: when the memory becomes full, only one thread that's blocked like this gets awoken. no cap, just one. π
data gets read from src and stored in dest.
the semantics of readFE are, in order, periodt:
src's FEB state must be"full"- data is copied from
srctodest src's FEB state gets changed from"full"to"empty"
π WARNING π
this one, and literally all the other FEB-related functions, currently operate exclusively on aligned data. this is to simulate the behavior of the XMT as closely as possible. the library requires 4- or 8-byte alignment, depending on whether you compiled in 32-bit or 64-bit mode. pls don't skip this part, she's serious π
β RETURN VALUE β
on success: the memory address src is marked empty, the memory address dest is filled with the contents of src, and 0 is returned. slay. π
on error: a non-zero error code is returned. π
π ERRORS π
ENOMEMβ not enough memory could be allocated for bookkeeping structures. sad girl hours, honestly.
π SEE ALSO π
qthread_empty(3)qthread_fill(3)qthread_writeEF(3)qthread_writeF(3)qthread_readFF(3)qthread_lock(3)qthread_unlock(3)
okay that's the whole page, bestie, you ate that. this was brought to you by libqthread, dated APRIL 2011 β yeah she's a vintage queen and she still runs the group chat. mwah ππ
π¦ where this page comes from
- fedora 43: qthreads-devel 1.22^20251007gitcedb1fc-1.fc43 Β· BSD-3-Clause AND MIT AND dtoa
- fedora 44: qthreads-devel 1.22^20251007gitcedb1fc-2.fc44 Β· BSD-3-Clause AND MIT AND dtoa
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms