2 ms·
If I'm writing an async program (that is, with an async main()), then no, I'll never be shutting my runtime down. But if I already have a non-async program, bu
by kelnos 2y ago
If I'm writing an async program (that is, with an async main()), then no, I'll never be shutting my runtime down.
But if I already have a non-async program, but need to use an async library, then yes, I'll probably spin up the runtime before using the library, and shut it down after I'm done using it. Unless of course I expect to be using that library for the full run-time of my program, in which case it'll exist for the duration.
- Joker_vD 2y ago> I'll probably spin up the runtime before using the library, and shut it down after I'm done using it. Hopefully the library did not leave any background tasks running that you can't ask it to stop :) Raymond Chen has a lot of enlightening horror stories about multi-threaded COM (and multi-threaded programming in general) on his blog that are applicable not only to Windows, but in general context as well.