Threading in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Threading in c++

here what i recently found out about how to create threads in c++ program. https://code.sololearn.com/cldJfaAORdiT (it runs on code::blocks) I know there is more simple way to do sum of first n numbers however for better understanding of threads I have implemented using loop. I want to know about threading in c++. I have two questions : Q.1 what should I refer to learn more? Q.2 how can i run this code on solo-learn.

21st Mar 2018, 7:02 PM
Tanay
Tanay - avatar
7 Answers
+ 17
Thank you.The Great Saga
4th May 2018, 7:06 PM
Tanay
Tanay - avatar
+ 9
I don't know much about threading but this might answer your questions. https://www.tutorialspoint.com/cplusplus/cpp_multithreading.htm
23rd Mar 2018, 3:45 AM
Tanay
Tanay - avatar
+ 4
https://github.com/Saga305/Linux
4th May 2018, 6:46 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
+ 3
More on threading: ~thread memory management ~thread synchronization ~thread builtin method like pthread_join,pthread_exit,pthread_self,pthread_attr*, etc
4th May 2018, 6:36 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
+ 2
I don't personally know about threading in C++ so I can't answer that question, but I have a few questions of my own for you: Why are you using typedef? Why are you using void pointers? Why are you using a global variable? If you know the type of variable you expect the function to be passed, then specify the type instead of using void pointers and assuming what you get is what you expected. I don't think it's necessary in this case to disregard C++'s built in type safety by using void pointers.
22nd Mar 2018, 9:58 PM
Sam
Sam - avatar
+ 1
you can get more codes for threading from above links
4th May 2018, 6:47 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar