qthread_readstate(3)

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

πŸ’– qthread_readstate(3) πŸ’–

libqthread · the lil' introspective queen of the runtime ✨


🌸 NAME 🌸

qthread_readstate β€” bestie, she returns status information straight from the runtime 🫢


✨ SYNOPSIS ✨

#include <qthread.h>

size_t
qthread_readstate (const enum introspective_state type);

πŸ’… DESCRIPTION πŸ’…

okay so picture this: this function is literally just the runtime doing a lil' vibe check on itself πŸͺžβœ¨. That's it. That's the whole job. The type argument tells her which piece of gossip you wanna hear about, and she hands it over as a size_t.

The valid values of type include, and yes we're going through all of them, no skimming bestie πŸ’€:

  • STACK_SIZE β€” makes the function return the size of the stack, measured in bytes, that all spawned qthreads receive. every single one. same stack size, no favorites πŸ’–
  • RUNTIME_DATA_SIZE β€” makes the function return the size of the runtime data structure that all spawned qthreads require. the whole squad needs it, so it's giving mandatory πŸŽ€
  • BUSYNESS β€” makes the function return the approximate number of threads available in the run queue of the current shepherd. approximate!! don't come for her if it's off by a lil bit πŸ™ˆ
  • ACTIVE_SHEPHERDS β€” makes the function return the number of shepherds currently active and scheduling threads. this one is equivalent to calling qthread_num_shepherds(). same energy, different font ✨
  • TOTAL_SHEPHERDS β€” makes the function return the total number of shepherds that exist, whether active or inactive. she counts the sleepers too, no one's left out 🫢
  • ACTIVE_WORKERS β€” makes the function return the number of worker threads currently active and scheduling threads. this one is equivalent to calling qthread_num_workers() πŸ’…
  • TOTAL_WORKERS β€” makes the function return the total number of worker threads that exist, whether active or inactive. again, sleepers included, everyone gets counted bestie 😭
  • CURRENT_WORKER β€” makes the function return the ID of the current worker on which the task is executing. this one is equivalent to calling qthread_worker(). it's giving main character β€” it's literally about you πŸŽ€πŸ‘‘
  • CURRENT_TEAM β€” makes the function return the ID of the calling task's team. this one is equivalent to calling qt_team_id(). know your team, love your team πŸ¦‹
  • PARENT_TEAM β€” makes the function return the ID of the calling task's team's parent-team, if it had one. this one is equivalent to calling qt_team_parent_id(). if your team has no parent, welp, that's a whole different story πŸ’€

🌈 SEE ALSO 🌈


no cap, that's the whole page β€” go forth and introspect, bestie πŸ§šπŸ’œ

k bye, this was libqthread, APRIL 2011, slay πŸ’…βœ¨

πŸ“¦ where this page comes from