http://www.cs.rpi.edu/index.htmlconnect your client to port 80 on www.cs.rpi.edu and then send the following request:
GET /index.html HTTP/1.0followed by two newline characters. In order to test how much threads speed up run time, you need to time each operation. To do this, use the function
#includeYour program should print out the time that it takes to download each document, the total number of bytes downloaded for each document, and the total run time of the program. In the serial case, the total run time of the program should be greater than the sum of the all of the download times, while in the parallel case, it should be somewhat less. A sample input file might look like this:hrtime_t gethrtime(void); DESCRIPTION gethrtime() returns the current high-resolution real time. Time is expressed as nanoseconds since some arbitrary time in the past; it is not correlated in any way to the time of day, and thus is not subject to resetting, drifting, etc. gethrtime() returns an hrtime_t, which is a 64-bit (long long) signed integer. EXAMPLE The following code fragment measures the average cost of getpid(2): hrtime_t start, end; int i, iters = 100; start = gethrtime(); for (i = 0; i < iters; i++) getpid(); end = gethrtime(); printf("Avg getpid() time = %lld nsec\n", (end - start) / iters);
http://www.cs.rpi.edu/courses/index.html http://www.w3.org/News/Archive.html http://www.freebsd.org/index.html http://www.yahoo.com/Computers/index.html http://www.caldera.com/LDP/LDP/tlk/tlk-toc.html http://www.linux.org/index.htmlSince this contains six documents, in the parallel case, your program should create six threads, one for each document. The main thread of your document should then issue a join for each thread. In the serial case, the program would just download each of the six documents in order. Some documents might hang for extended periods of time. If a document takes more than 20 seconds to download, the download of that document should be aborted, and a suitable error message displayed. You can choose to write the program either in Java or in C or C++. Note that this project can only be done on a computer which supports threads, i.e. Solaris. This project is due at midnight on December 4.