C++ Simple Thread (c++11 and up)
#include <string> #include <iostream> #include <thread> using namespace std; // The function we want to execute on the new thread. void task1(string msg) { cout << “task1 says: ” << msg; } int main() { // Constructs the new thread and runs it. Does not block execution. thread t1(task1, “Hello”);Continue Reading