From the course: Complete Guide to Parallel and Concurrent Programming with C++

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Challenge: Download images

Challenge: Download images

(upbeat music) - [Instructor] For our third and final challenge problem, your goal will be to design and build a program to concurrently download a sequence of image files from the internet and return their total number of bytes. We've hosted 50 images at the URL shown here, which we'll use as the target files to download for this challenge. It's a series of JPEG files, and they're numbered sequentially from one to 50. As a starting framework for this challenge, we've implemented a sequential version of an image downloader function at line 13, which has a single input parameter for the number of images to download. It simply uses a for loop to repeatedly call the download image helper function on line 16, passing it a different value each time from one to the number of images to download. That download image function will download the corresponding image file from the internet and then return its file size in bytes, which gets added to an accumulator variable named total bytes. At the…

Contents