+ 3
So, pthread.h is off limits?
I guess the title says a lot, but I tried to run a C code in the playground, and couldn't include the pthread header file. https://code.sololearn.com/c4bFCVcLmtTL
5 ответов
+ 9
Lol thanks for the heads up.
+ 5
Nevermind, I just remembered that the code is ran on windows. 'pthread.h' does not exist in Windows. In Windows you actually use the multithreading techniques provided by 'windows.h'. Sorry for bothering, but hopefully this helped someone else as well.
+ 4
I think even if SoloLearn ran on linux computers, you would not be able to use pthread.h as they might not add the linking option '-lpthread'
+ 2
If anyone is interested, here's an example of multithreading within C, and also an example on how to pass an array to functions, or other threads.
https://code.sololearn.com/crzyaEUJde4z/?ref=app
+ 2
Yeah, that's true. Haven't thought of that, but they could definitely fix that with some "clever" engineering.