181351 posts 1993 follows 1215 followers
Please pay attention to random failures.
https://mstdn.maud.io/@omasanoriIf your threads aren't saturating your CPU, you do not need threads.
You almost certainly shouldn't use threads even if they are (try processes instead), but unless you are CPU bound, you definitely, definitely should not use threads.
Linking to pthreads is how you invite a Lovecraftian madness into your program. Take it from an old hand, and never, ever use threads. Their use is almost never justified, and their consequences are severe.