Use threads instead of std::future