main thread waits for std::async to complete [duplicate]
问题 This question already has answers here : Can I use std::async without waiting for the future limitation? (4 answers) Closed 2 years ago . I am using std::async to create a thread, I want this new thread should execute separately and main thread should not wait for it. But here when I call std::async, a new thread is created but main thread is waiting for completion of fun() . I want main thread to execute parallely without waiting for fun() to complete. How should I do that? #include