3 ms·
Whether async or threads are preferable depends a lot on context and often the answer will be "both". E.g. GUI code -> async, because you must do everything on
by formerly_proven 6y ago
Whether async or threads are preferable depends a lot on context and often the answer will be "both".
E.g. GUI code -> async, because you must do everything on the UI thread. Heavy lifting in a GUI app -> threads. Traditionally you'd do this with a huge mess of callbacks, but these days it's reasonably easy to just write the GUI portion using async and have background computations run in threads signal their results through futures into the async code, which makes everything so much easier.