qutil_double_max(3)

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

πŸ’– qutil_double_max β€” the manual page, but make it cute

okay bestie, welcome to libqthread</> πŸ’… this is qutil_double_max(3), and yes the header up there also covers its two ride-or-die siblings qutil_uint_max and qutil_int_max. all three of them do the same adorable thing: they go find the biggest number in an array, and they do it in parallel. no cap. πŸ”₯


✨ NAME ✨

qutil_double_max, qutil_uint_max, qutil_int_max β€” find the maximum value within an array in parallel πŸ†


🌸 SYNOPSIS 🌸

like, the whole vibe in code form:

#include <qthread.h>
#include <qthread/qutil.h>

double
qutil_double_max (double *array, size_t length, int checkfeb);

unsigned int
qutil_uint_max (unsigned int *array, size_t length, int checkfeb);

int
qutil_int_max (int *array, size_t length, int checkfeb);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie β˜• these functions take an array of length numbers as input and hand you back the maximum value chillin' inside those numbers. and the way they do it?? in parallel, obviously. πŸ’… they use a chained-loop structure and spin up qthreads to compute the max in chunks. it's giving divide and conquer, it's giving teamwork, it's giving main character energy. πŸ‘‘

about that checkfeb situation: if checkfeb is non-zero, these functions will wait for the entries in the array to be full before comparing them. that's the whole point of the FEB wait. 🫢

⚠️ but hear me out β€” they DO NOT check whether the array entries are properly aligned. not even a little. that's on you, bestie. πŸ™ˆ
πŸ’€ and if the datatype is too small to do a FEB operation on, they will abort β€” but only if sanity checks are turned on. so like, keep those on. please. for me.

🌈 RETURN VALUE 🌈

the maximum value of the first length entries of array. that's it, that's the whole gift. 🎁✨


πŸŽ€ SEE ALSO πŸŽ€

the whole friend group, all together, iconic behaviour:


sign-off time 🫢 this whole thing lives under libqthread, dated APRIL 2011, and it's literally the qutil_double_max(3) page. ok bye, go find your max, bestie πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from