Domanda

If you have 10 tasks, and each one takes 5 seconds to download, so 50 seconds total, would you be able to accomplish the task quicker by running 10 parallel threads and downloading all 10 at once?

I think it would take slower, but I don't really know.

Would this hold true of Android? Would running 10 parallel downloads be faster then running them in a single priority queue?

edit: if it matters I'm seeing a average .20 Mbps - .50 Mbps average in the locations where the downloads would likely take place.

È stato utile?

Soluzione

It depends where the bottleneck is.

If you're downloading from 10 different servers and they're all serving up the data relatively slowly, it's possible you have enough bandwidth on the device to download from all 10 (or at least some number greater than one) at the same time, in which case multiple threads will be faster.

However, if a single download from one server is already enough to use up all of your bandwidth, then 10 at the same time isn't going to be any faster. And the extra overhead and contention for resources will likely make it slower.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top