qthread_distance(3)

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

✨ qthread_distance ✨

okay bestie, welcome to the libqthread manual, and specifically to qthread_distance(3) β€” the lil function that tells you how far apart your shepherds are living. yes, shepherds. like, the worker threads. we're doing farm-core terminology, it's fine, it's iconic πŸ’…


🌸 NAME 🌸

qthread_distance β€” returns the distance between shepherds


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qthread.h>

int
qthread_distance (const qthread_shepherd_id_t src, const
qthread_shepherd_id_t dest);

πŸ’– DESCRIPTION πŸ’–

so basically, this function returns the distance from the src shepherd to the memory of the dest shepherd. that's it, that's the whole vibe. you hand her two shepherd ids, she tells you how far apart they're sitting. 🫢

now here's the tea: those distances are arbitrary. like, they are not a precise latency measurement, no cap. they may not exactly measure latency to memory, but they <em>do</em> give you an indication of relative distance β€” so it's giving "which one is closer" energy, not "here's the exact nanosecond count" energy. ngl, that's still super useful.

and one more thing, because this part matters: shepherds that do not have a specific CPU affinity can be anywhere. like, truly anywhere, main character roaming privileges. so the distance from or to such shepherds is considered 0. πŸŽ€


πŸ‘‘ RETURN VALUE πŸ‘‘

this function either returns the distance between the two specified shepherds, or β€” if a shepherd identifier is invalid β€” it returns QTHREAD_BADARGS. so yeah, if you get that back, one of your ids was not it, bestie 😭


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! this one came from <strong>libqthread</strong>, dated <strong>APRIL 2011</strong> β€” yes she's vintage, she's a classic, she's serving archival excellence, and we respect her πŸ’œβœ¨

πŸ“¦ where this page comes from