+ 2

How to implement Multi Threading in C.

I am working on a project that requires two simultaneous processes to run and communicate with each other. I want them to be able to read each others outputs and work with the output.

25th Jun 2019, 6:58 AM
Tickloop
Tickloop - avatar
4 Antworten
+ 2
Agent_I you are deathly wrong. C added support for multithreading in C11. You can use it as well as you can in C++. Look it up at cpprefrence.com. C's multithreading library is really cool.
25th Jun 2019, 8:07 AM
Mensch
Mensch - avatar
+ 2
Trekker ah yes, you're right. I didn't know it cause I usually use the older C. Thanks for the correction
25th Jun 2019, 8:17 AM
Agent_I
Agent_I - avatar
+ 1
You can use the pthreads header file. Check out tutorials of multithreading with pthreads online.
25th Jun 2019, 7:42 AM
Mensch
Mensch - avatar
+ 1
I'm afraid that C doesn't have any standard library regarding multi-threading. C++, however, does have it. The implementation itself is almost the same as in Java
25th Jun 2019, 7:46 AM
Agent_I
Agent_I - avatar