DEV Community

Discussion on: Basics of multithreading in C

Collapse
 
quantumsheep profile image
Nathanael Demacon

pthread.h is POSIX compliant, threads.h isn't.

But sure you can use it, it's implemented in linux and freeBSD kernels.

Collapse
 
noah11012 profile image
Noah11012

But threads.h is C11 compliant so by now ALL compilers have support for C11 at least for the three major ones:

MSVC
GCC
CLANG

Thread Thread
 
quantumsheep profile image
Nathanael Demacon

Yup, seems nice, their is just a lack of documentation, I wanted to know what did it really does.

Thread Thread
 
noah11012 profile image
Noah11012

You can find documentation here: en.cppreference.com/w/c/thread

Thread Thread
 
jl2210 profile image
JL2210

Well, it's the C libraries for two of those platforms that are supposed to implement threads.h (even though I'm pretty sure glibc doesn't), although I'm not sure what Windows does.

Collapse
 
jl2210 profile image
JL2210

It's not the kernels, it's the C libraries. You can have a kernel installed and not be able to do anything without a C library.