How to write a thread program in c? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

How to write a thread program in c?

Multithreading or in short threading in c

29th Jan 2018, 2:46 AM
Hacked
2 Réponses
+ 14
Unlike Java, multithreading is not supported by the language standard. POSIX Threads (or Pthreads) is a POSIX standard for threads. Implementation of pthread is available with gcc compiler. For more 👇 https://www.geeksforgeeks.org/multithreading-c-2/
29th Jan 2018, 4:23 AM
🌛DT🌜
🌛DT🌜 - avatar
+ 3
Use the C11 threads.h: http://en.cppreference.com/w/c/thread Note: You must use the musl library instead of glibc, as it's the only library I know of that implements the header. Edit: Here's a small header file that implements the threads.h interface on top of POSIX threads: https://github.com/jtsiomb/c11threads
29th Jan 2018, 4:58 AM
Vlad Serbu
Vlad Serbu - avatar