Re: downloading a single file using multiple threads



On Mar 28, 10:30 am, "Willy Denoyette [MVP]"
<willy.denoye...@xxxxxxxxxx> wrote:
<keerthyragavend...@xxxxxxxxx> wrote in message

news:1175057072.261471.167010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

hi

i'm downloading a single file using multiple threads...
how can i specify a particular range of bytes alone from a single
large file... for example say if i need only bytes ranging from
500000 to 3200000 of a file whose size is say 20MB...
how do i request a download which starts directly at 500000th byte...
thank u
cheers

Simple answer: you can't *download* a file in chunks, unless you implement a client/server
protocol for this.

Note that there already protocols which *do* support this, including
FTP and HTTP, both optionally as far as the server is concerned.

The question is - what makes you think you need multiple threads to *download* a file? If
you think you can speed-up the download by doing this, then you are wrong. The bottleneck
will always be the network, so if you download the file in one chunk, you'll get the maximum
throughput, introducing multiple threads will actually slowdown the whole process.

That depends - some servers may throttle per connection, at which
point it may make sense to have multiple connections (although
somewhat naughty). Also, in a more advanced way, if the same file is
available through multiple mirrors, it may make sense to get different
bits from different mirrors.

This is a fairly common thing to do - a lot of web "download managers"
do it.

Jon

.



Relevant Pages

  • Re: List of Hotfixes to fix DX10/SLI/GPU/Memory in Gaming
    ... 'KB933590 - Fixes issues when running multiple monitors when playing ... Request Download: ... Download the AMD 64 Multiple Core Optimizer (Enhances performance while ... nHancer - The Advanced Control Panel and Profile Editor for ...
    (microsoft.public.windows.vista.games)
  • WinFlash Educator 10.10.07
    ... Educator offers powerful multimedia support while retaining its ... Choose from standard, fill-in or multiple ... foreign language study, speeding both creation and study phases. ... dictionaries are available for free download. ...
    (comp.software.shareware.announce)
  • Re: Which folders are shortcuts?
    ... "For general shortcuts, I would agree with what you say, but the OP is ... >> for what appears to be multiple entries.. ... >> computer illiterates download stuff and don't know where its gone, ... >> to be in multiple folders, ...
    (microsoft.public.windowsxp.basics)
  • Re: Is it better to use threads or fork in the following case
    ... download the data and then have another to actually process the data. ... That said, if you are thinking from a responsiveness perspective, I would definitely say threading. ... If you ask from a performance perspective I would need to know what OS you are running and if you have multiple CPU's and if you are actually planning on spawning that sub-process on a a different CPU as the parent process. ...
    (comp.lang.python)
  • Re: Writing a bare bones Download manager
    ... or can i tune tune wget so that it can download a file streaming man ... i mean to download using multiple connections for each section (say 4 ...
    (comp.programming)