I only know C#:
https://learn.microsoft.com/en-us/dotnet/csharp/async#recogn...
There you also have to act differently based the task
There you also have to act differently based the task
The docs on that page also point you to a different task library which does what I'd expect:
"If the work is appropriate for concurrency and parallelism, also consider using the Task Parallel Library."
I checked those docs and that is a framework that makes sense.