qutil_double_min(3)
β¨ qutil_double_min β¨
okay bestie, welcome to the libqthread section 3 club π this little trio of cuties lives in the manual page qutil_double_min(3) and honestly? they're the friend group that finds the smallest number in the room and does it in parallel, which is iconic behavior π
πΈ NAME πΈ
qutil_double_min, qutil_uint_min, qutil_int_min β find the minimum value within an array in parallel
no cap, that's literally the whole job description π«Ά
β¨ SYNOPSIS β¨
#include <qthread.h>
#include <qthread/qutil.h>
double
qutil_double_min (double *array, size_t length, int checkfeb);
unsigned int
qutil_uint_min (unsigned int *array, size_t length, int checkfeb);
int
qutil_int_min (int *array, size_t length, int checkfeb);
three functions, three flavors, same vibe π
π DESCRIPTION π
so here's the tea β these functions take an array of length numbers and hand you back the minimum value hiding in there. not the max, not the sum, the min β the smallest one, the underdog, the main character of lowkey-ness π
and the way they do it? in parallel β¨ using a lagging-loop structure. yes queen, multithreaded minimum-finding, we love to see it π
now about that checkfeb argument, listen up because this part matters:
- if
checkfebis non-zero, these functions will wait for the entries in the array to be full before comparing them π«Ά - they DO NOT check whether the array entries are properly aligned. not even a little. not even a glance π
- if the datatype is too small to do a FEB operation on, they will abort β but only if sanity checks are turned on π¨
bestie pls read that again. alignment is YOUR problem, not theirs. they are not checking. they said what they said π
π RETURN VALUE π
the minimum value of the first length entries of array π
that's it. that's the whole return. a single tiny value, served fresh, computed in parallel, no notes β
π¦ SEE ALSO π¦
qutil_double_mult(3)qutil_double_sum(3)qutil_double_max(3)qutil_uint_mult(3)qutil_uint_sum(3)qutil_uint_max(3)qutil_int_mult(3)qutil_int_sum(3)qutil_int_max(3)qutil_mergesort(3)qutil_qsort(3)
go read the rest of the squad, they're all slaying in their own ways π§π
and that's a wrap on this page from libqthread, dated APRIL 2011 π
β yeah she's an elder but she still eats, fr fr. stay aligned, stay parallel, and never forget to pass a non-zero checkfeb if you actually want the full-wait behavior ππ
β¨
π¦ 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