Hi all,
I'm trying to compile and run the below code. As a result, only one copy
of "f" is being executed at a time, that is, no new threads are spawned.
Does anyone know what's going on?
cygwin 2.4.1, gcc 5.3.0, compilation options are "g++ test.cpp -o test
-O3 -Wall -std=c++11 -lpthread".
Ilya
#include <future>
#include <iostream>
using namespace std;
void f(int id) {
for (int i = 0; i < 100000; ++i) {
cout << id << endl;
}
}
int main() {
std::async(std::launch::async, &f, 1);
std::async(std::launch::async, &f, 2);
return 0;
}
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple