#include #include #include int main() { const int N = 2; std::future f[N]; for (auto& i: f) i = std::async([] { while (true) std::cout << "hola, soy " << std::this_thread::get_id() << std::endl; }); }