Timing Threads

Due Date

Before lecture on Friday, April 5

Assignment

On your single CPU AWS instance do the following.

  1. Create a directory in your repository named timed_threads.  Copy the multi threaded program (demo2.c) that you wrote when following the second YouTube video in the last assignment into the timed_pthreads directory.  Rename demo2.c to timed_threads.c.
  2. The time() function (specified in time.h) returns the number of seconds since the UNIX Epoch (pronounced ˈepək) , 1970-01-01 00:00:00 +0000 (UTC).  In timed_threads.c, add two calls to time().  Make the first call at the beginning of main() and the second call, just before your program terminates. Prior to terminating, print to the console the time difference.
  3. Compile and run your program and take a screenshot of the result.  Name the screenshot single-cpu-result.xxx where xxx is the file extension.
  4. Commit the source code and screenshot to your repository and push the contents to GitHub.

Check your AWS account to verify that you have AWS Educate credits.  You can find the credits page by going to https://aws.amazon.com/, clicking on My Account, and choosing AWS Management Console.  Then click on your username in the upper right corner, and press My Account.  Choose Credits in the menu on the left side. If you have credit it will be listed at the bottom of the page.

If you do not have Educational credit, email me a screenshot of your My Account page and the Credits page.

Create a new Multi-core AWS instance. You can find the online comparison of AWS instances at https://www.ec2instances.info/.

On your multi-core AWS instance do the following.

  1. Clone your GitHub repository.
  2. Install development tools on the instance using yum.
$sudo yum group install "Development Tools"
  1. Compile and run your program and take a screenshot of the result.  Name the screenshot multi-core-result.xxx where xxx is the file extension.
  2. Commit the source code and screenshot to your repository and push the contents to GitHub.

© 2019, Eric. All rights reserved.