Can we multi thread in the C++ sandbox? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we multi thread in the C++ sandbox?

From a couple experiments I've discovered that the sandbox is a Windows 32 host that uses GCC 4.8 through Mingwin. It supports cxx11 but not std::thread nor posix threads. Is there any way to do a MT app in C++ using Windows threads?

7th Dec 2017, 1:51 PM
Simon
Simon - avatar
2 Answers
+ 2
Thanks for the hint, a quick search on google got me a working example from stack overflow. _beginthreadex is not found but CreateThread exists and seems to work fine at least in the example. https://stackoverflow.com/a/7739131/1946427 https://code.sololearn.com/cl2pYMK5Ib9W
7th Dec 2017, 5:10 PM
Simon
Simon - avatar
0
Maybe there are limits in place for the amount of threads that can run at the same time. Anyway it's nice that you got it working but I was hoping for a STL implementation. I guess the sandbox vm is too limited for that. Kind of odd they'd choose Windows over Linux for this purpose.
8th Dec 2017, 2:25 AM
Simon
Simon - avatar