By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

Declined Multithreaded internet operations

When dealing with internet resources, operations like a multiple copy, are very slow:
copy ftp://ftp.elf.stuba.sk/pub/pc/pack c:\test

Would it be possible to do them in parallel?
I chose one of the largest files there, wnzip170.exe (~100MB). I could download it in 1:05 (far below my local capabilities). With three instances of TCC I could download three copies of the same file in the same amount of time. I suspect that server has a download speed limit of about 2MB/sec/connection. So multiple threads (multiple connections) would help (up to a point).


1. When I was done, the drive I downloaded to had gone from 0% fragmented to 7% fragmented.

2. Using multiple connections seems somewhat rude to other users of the server.
That server allows a maximum of 5 connections per IP so perhaps it isn't too rude to use five connections. With a BTM (below) I downloaded 5 copies of wnzip170.exe (~100MB) in the same time as one copy. When it was over my disk had gone from 0% fragmented to 14% fragmented.

So yes (again) multithreaded downloading would save time, but

1. It will lead to a highly fragmented disk.
2. There's no telling how many connections from one IP a server will allow.
3. It might be quite difficult to implement (and have value only very occasionally)


setarray z[5]

do i=0 to 4
    if not exist v:\test%i md v:\test%i
    start /c copy ftp://ftp.elf.stuba.sk/pub/pc/pack/wnzip170.exe v:\test%i
    set z[%i]=%_startpid

do while %@isproc[%z[0]] == 1 .or. %@isproc[%z[1]] == 1 .or. %@isproc[%z[2]] == 1 .or. %@isproc[%z[3]] == 1 .or. %@isproc[%z[4]] == 1 
    delay 1


unsetarray z
Indeed the advantage is mostly with small files.