- 4
Why thread.detach not continuing when using thread::sleep_for in main thread but it continues if i loop print " "
https://code.sololearn.com/chnWmjf3UN01/?ref=app and works when looping printing: https://code.sololearn.com/cH3b1qlP3i81/?ref=app
18 Réponses
+ 1
Im waiting at the end so detach can continue
+ 1
Have you tried your code outside of code playground?
+ 1
Is sololearn compiler broken
+ 1
I tried both
+ 1
It's not broken but it does not support all features of an offline system.
+ 1
Only the one with loop is working
+ 1
The other is
Saying no output
+ 1
E.g. delays/sleep will not work on code playground.
+ 1
I tried on dev c++
+ 1
It works there
+ 1
I use it to pause the program
+ 1
Detach will continue
+ 1
Is sololearn compiler broken
+ 1
return 0; it's not broken but codes with multithreading, sleep/delay will not work on code playground.
+ 1
I tried using different compilers
+ 1
It worked there
+ 1
Sololearn c++compiler isnt good
+ 1
Hello return 0;
I want to inform you, that I have "fixed" your question.
Your question is now in the title and your codes in the description. That helps the user to see which problem you have.
And I fixed the tags so that your question is searchable.
Btw: You can also edit your own questions to change title/description/tags.
For the next time you can read here how to ask clear questions in q&a: https://www.sololearn.com/blog/38/8-simple-rules-to-get-help-from-the-community
Happy coding :)