How to write a thread program in c? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

How to write a thread program in c?

Multithreading or in short threading in c

29th Jan 2018, 2:46 AM
Hacked
2 Respostas
+ 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