async's high-level API spawns lexically scoped threads, ensuring the following key poperties that make it safer to use than using plain forkIO:
No exception is swallowed (waiting for results propagates exceptions).
No thread is leaked (left running unintentionally).
Recently we've observed some infinite loops when one of the threads was crashing and I suspect this could fix that issue. I don't have a concrete example to share.
using
forkIO
is not recommended because:Recently we've observed some infinite loops when one of the threads was crashing and I suspect this could fix that issue. I don't have a concrete example to share.