> The limit here is the connection/http latency. The other parts are super fast.

I cover this in my blog post 
<https://nim-lang.org/blog/2021/02/26/multithreading-flavors.html>

What is important is **how do you make progress**.

If your program makes **progress by working** , yes Weave is a suitable tool. 
If your program makes **progress by waiting** , async is the ideal solution, 
and you can await thousands of files, network connections or user inputs before 
needing multiple cores.

In the first case, you can throw more cores, in the second case, say 
downloading a file, throwing more core at a download won't speed them up.

> I don't think async can be used here, unless I simulated some kind of thread 
> pool to manage the number of parallel jobs, which defeats the purpose I think.

That's where you're wrong, async is the ideal solution there. You start many 
downloads, await for the first one to finish, process, switch to the next. 
Downloads are already managed in the background by the OS.

Reply via email to