I know that the implementation of threads in the Linux kernel and libc went through big changes in the past. What is the best way to use threads today from C programs? (I don't even know if there is more than one API that I can use -- I just know pthreads)
I don't care too much about old kernels and libc versions, but I do care about making efficient use of multiple cores and about portability (I may want my code to also work on other Unixes).
If I just use Posix threads as described in man 7 pthreads
and restrict my code to the POSIX API will that be OK?
edit: thanks to all who answerd. I did think of using some available thread pool library, but for this project this really isn't an option.