qthread_readFF(3)

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

πŸ’– qthread_readFF β€” bestie edition πŸ’–

okay so this is a page from libqthread, and we're talking about qthread_readFF(3). yes the title is the function name, that's just how manpages do, don't @ me. anyway sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

qthread_readFF β€” waits for the source to be full, then copies it

like. it waits. then it copies. that's the whole personality πŸ’…


🌸 SYNOPSIS 🌸

#include <qthread.h>

int
qthread_readFF (aligned_t *dest, const aligned_t *src);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•

This function waits for memory to become full, and then reads it β€” and when it's done, it leaves that memory still full. it does not empty it. it does not consume it. it's a read that keeps the vibe intact, no cap.

The moment memory becomes full, every single thread that was waiting on it to become full via a readFF gets the value at once, and they all get queued up to run. it's giving group chat when someone finally drops the link 😭

Data is read from src and stored in dest. simple. iconic.

The semantics of readFF are, and I quote, exactly this:

1 - src's FEB state must be "full"
2 - data is copied from src to dest

that's it. two steps. a two-step. periodt. πŸ‘‘


⚠️ WARNING ⚠️

bestie. listen. this, and all other FEB-related functions, currently operate exclusively on aligned data. like, exclusively. no exceptions. this is on purpose β€” it's to simulate the behavior of the MTA as closely as possible.

The library requires 4- or 8-byte alignment, depending on whether it's compiled in 32-bit or 64-bit mode. so like, know your build. pls. πŸ™ˆ


πŸ’« RETURN VALUE πŸ’«

On success:

  • the memory address src is marked full βœ…
  • the address dest is filled with the contents of src βœ…
  • and 0 is returned πŸŽ€

On error, a non-zero error code is returned. that's your sign that something went sideways, fr fr.


πŸ’€ ERRORS πŸ’€

  • ENOMEM β€” Not enough memory could be allocated for bookkeeping structures. the bookkeeping couldn't be booked. tragic. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

your required reading, bestie, go read them all:


and that's the whole page, you ate it, I'm so proud of you πŸ₯Ήβœ¨ this was libqthread, APRIL 2011 β€” yes, 2011, she's vintage, she's an elder, respect her πŸ’œ β€” mwah, bye bestie, go write some aligned data πŸ¦‹πŸŒΈπŸŽ€

πŸ“¦ where this page comes from