Fire-and-forget with PPL?

446 views Asked by At

I'm looking to start using PPL in my application. (I'm currently using std::async)

I however have two (ugly) cases where I have to call long running functions that don't return any results. (Storing to database, and a network call). I don't wait for them to finish at the end of my main loop (as they are very slow), but simply continue on with the next iteration. I do this by spawning threads for these function calls, and detach the threads. I believe this is called fire-and-forget.

Is there a way to do fire-and-forget with PPL? Id like to avoid creating my own threads, and use void PPL tasks. Do PPL tasks block in the destructor?

0

There are 0 answers