Is multithreading supported in C? If yes, then how do I try? Is there any open source library that lets me do it and is the library supported on Mac OS X?
I haven’t found any article saying that it’s supported.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C is not intrinsically a multithreaded language; however there are many libraries which add threading functionality.
pthreadsis a library compatible with any POSIX system, so it is supported on OSX. I found https://hpc-tutorials.llnl.gov/posix/ to be a good place to start.Win32 has a threading library for C described at https://learn.microsoft.com/en-us/cpp/parallel/multithreading-with-c-and-win32.
Glibadds threading supported, and has the advantage of being completely cross-platform, as long as glib is installed on the target machine. There is some information here: http://developer.gnome.org/glib/2.28/glib-Threads.html