Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File downloaders are programs you will implement two different types of multi-process downloaders (i.e., file downloaders that comprise multiple processes) s used for downloading files

image text in transcribed

File downloaders are programs you will implement two different types of multi-process downloaders (i.e., file downloaders that comprise multiple processes) s used for downloading files from the Internet. In this assignment i. a serial file downloader which downloads files one by one 2. a parallel file downloader which downloads multiple files in parallel. You will then compare the performance of the two types of downloaders. Both downloaders will use the Linux wget program in order to perform the actual downloading The usage of the wget is simple: wget . For example, running from command line the following command wget http://releases.ubuntu.com/15.04/ubuntu-15.04-desktop-amd64.iso will download the Ubuntu Linux iso image to the current directory. Before proceeding with the assignment, you may want to take a moment to experiment with the wget command. In your program, the parent process shall first read the file, urls.txt, containing the URLs of the files to be downloaded. urls.txt shall have the following format: For example http://releases.ubuntu.com/cosmic/ubuntu-18.10-desktop-amd64.iso http://releases.ubuntu.com/cosmic/ubuntu-18.10-live-server-amd64.iso Next, the parent process shall fork the child processes. Each created child process shall use the execlp0 system call to replace its executable image with that of the wget program. The two type downloaders are described in detail below The two downloaders shall be implemented as separate programs. The serial downloader program shall be called serial.c (or.cpp extension if you use C+t). The parallel downloader program shall be called parallel.c (or .cpp extension if you use C++) Serial Downloader The serial downloader shall download files one by one. After the parent process has read and parsed the urls.txt file, it shall proceed as follows 1. The parent process forks off a child process The child uses execlp("/usr/bin/wget", "wget", , NULL) system call in order to replace its program with wget program that will download the first file in urls.txt (i.e. the file at URL ) 2. 3. The parent executes a wait0 system call until the child exits 4. The parent forks off another child process which downloads the next file specified in urls.txt Repeat the above steps until all files are downloaded. 5. Parallel Downloader 1. 2. The parent forks off n children, where n is the number of URLs in urls.txt. Each child executes execlp("/usr/bin/wget", "wget", , NULL) system call where each . For example, running from command line the following command wget http://releases.ubuntu.com/15.04/ubuntu-15.04-desktop-amd64.iso will download the Ubuntu Linux iso image to the current directory. Before proceeding with the assignment, you may want to take a moment to experiment with the wget command. In your program, the parent process shall first read the file, urls.txt, containing the URLs of the files to be downloaded. urls.txt shall have the following format: For example http://releases.ubuntu.com/cosmic/ubuntu-18.10-desktop-amd64.iso http://releases.ubuntu.com/cosmic/ubuntu-18.10-live-server-amd64.iso Next, the parent process shall fork the child processes. Each created child process shall use the execlp0 system call to replace its executable image with that of the wget program. The two type downloaders are described in detail below The two downloaders shall be implemented as separate programs. The serial downloader program shall be called serial.c (or.cpp extension if you use C+t). The parallel downloader program shall be called parallel.c (or .cpp extension if you use C++) Serial Downloader The serial downloader shall download files one by one. After the parent process has read and parsed the urls.txt file, it shall proceed as follows 1. The parent process forks off a child process The child uses execlp("/usr/bin/wget", "wget", , NULL) system call in order to replace its program with wget program that will download the first file in urls.txt (i.e. the file at URL ) 2. 3. The parent executes a wait0 system call until the child exits 4. The parent forks off another child process which downloads the next file specified in urls.txt Repeat the above steps until all files are downloaded. 5. Parallel Downloader 1. 2. The parent forks off n children, where n is the number of URLs in urls.txt. Each child executes execlp("/usr/bin/wget", "wget", , NULL) system call where each

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago