qthread_readFE(3)

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

πŸ’– 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:

  1. src's FEB state must be "full"
  2. data is copied from src to dest
  3. 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 πŸ‘‘


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