Java

Outline

Here is a basic outline of the steps to follow to complete this example.

  1. Clone Starter Code from GitHub
git clone <url> java
  1. Update ParallelOne to use 4 threads.

  2. Take a screenshot showing a race condition.

  3. Update ParallelOne to use a lock.

  4. Take a screenshot showing no race condition.

  5. Update ParallelTwo to use blocking and an arbitrary number of threads.

  6. Run several times with different number of threads (1 - 10) and graph results.

  7. Write in README.md to answer two questions

  8. When complete, use Git to commit and push updated code.

git add .
git commit -m "Example Complete"
git push
  1. On GitHub, create a release tag and submit URL to Canvas for grading.

Compiling and Running Java

Recall that you can compile a Java program using javac:

javac ParallelOne.java

You can then run it using java:

java ParallelOne