Question: Task/Threads simultaneous download

I want to download historical data from google finance for two Indecies simultaneous
but I dont understand where the output is saved...?!  Also should I use task or threads ?


restart:
with(Sockets):
with(Threads):


X1 := proc () local str, sid; global b; str := "";

sid := Open("google.com", 80);
Write(sid, cat("GET /finance/historical?q=INDEXSP:.INX&histperiod=daily HTTP/1.0 \n\n"));

b := Read(sid); while b <> false do str := cat(str, b); b := Read(sid) end do;

Close(sid);
str ;

end proc:


X2 := proc () local str, sid; global b; str := "";

sid := Open("google.com", 80);
Write(sid, cat("GET /finance/historical?q=INDEXEURO:.FCHI&histperiod=daily HTTP/1.0 \n\n"));

b := Read(sid); while b <> false do str := cat(str, b); b := Read(sid) end do;
Close(sid);
str

end proc:


Create(X1());
Create(X2());

Please Wait...