qt_double_max(3)

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

πŸ’– qt_double_max β€” bestie's guide to finding the max in parallel πŸ’–

okay so this is a page from libqthread's manual, and it's all about three little icons: qt_double_max, qt_uint_max, and qt_int_max. they all do the same gorgeous thing, just for different types. let's get into it ✨


✨ NAME ✨

qt_double_max, qt_uint_max, qt_int_max β€” find the maximum value within an array, but like… in parallel πŸ¦‹


🌸 SYNOPSIS 🌸

#include <qthread/qloop.h>

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

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

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

πŸ’… DESCRIPTION πŸ’…

so basically, these functions take an array that has length numbers in it, and they hand you back the maximum value hiding in there. and the way they find it?? in parallel, babes. the possible values get divvied up evenly among the shepherds, so everybody's working on their slice at the same time. teamwork makes the dream work fr fr 🫢

now, about that checkfeb argument β€” if it's non-zero, these functions will wait for the entries in the array to be full before comparing them. so they'll chill until everything's ready, no rushing πŸ’…

⚠️ but listen, bestie, they DO NOT check whether the array entries are properly aligned. like, at all. not even a little. so if your alignment is a mess, that's on you, not them 😭

⭐ RETURN VALUE ⭐

the maximum value of the first length entries of array. that's it, that's the tea πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘

go give these a lil read too, they're all in the same friend group:


and that's the whole page, bestie!! this one's from libqthread, dated JUNE 2007 β€” yes, literally ancient, but the max-finding slays just as hard today πŸ’–βœ¨ no cap, go find your maximum πŸ¦‹πŸ’…

πŸ“¦ where this page comes from