/Sixth-Assignment-Advanced-Multithreading

This assignment covers some advanced topics of multithreading in Java, including subjects such as handling Race Conditions, Synchronization problems, and Multithreaded Calculations.

Primary LanguageJava

Advanced Multithreading

Introduction

In this assignment, you are given three problems focused on various areas of multithreaded programming. Solve each exercise according to the provided guidelines.

Objectives

  • Review the concepts of multithreaded programming and utilize them correctly
  • Research Pi calculation algorithms
  • Familiarize yourself with the Semaphore, CountDownLatch, and BigDecimal classes
  • Learn the basics of writing a proper project report

Tasks

  1. Fork this repository and clone the fork to your local machine. Ensure to create a new Git branch before starting your work

  2. Complete the following exercises based on the instructions provided:

    • Calculate Pi: Calculate the value of Pi up to 1000 digits after the floating point. Find more instructions in the PiCalculator class.
    • Semaphore: Solve a synchronization problem using a Semaphore that allows 2 threads to enter the critical section. Find more instructions in the Controller class.
  3. Write a comprehensive report on the assignment.

Notes

  • You can find unit tests for the Calculate Pi exercise. Use these to ensure you've implemented the code correctly.
  • You are NOT allowed to use any other synchronization tool for the Semaphore exercise. Only Semaphores may be used.

Report

You are expected to write a detailed report on the assignment. This is the most important task expected of you, and over 50% of the assignment's final grade depends on it. Explain the solutions you chose for each exercise but try to focus on the Calculate Pi problem.
You MUST include the following details in your report:

  • The solutions you chose for each exercise and how you implemented them
  • All mathematical algorithms you tried and used for the Calculate Pi problem
  • Details on the final algorithm you chose for calculating Pi and its advantages over other algorithms
  • Explanation regarding Semaphore and its use cases
  • All References and Resources (include links where possible)

Your report can either be in the format of a PDF or Markdown file (Markdown is preferred). Including graphs, charts, and other appropriate visuals can grant bonus points.

Evaluation

  • Your code should compile and run without any errors
  • Your code should be well-organized, readable, properly commented and should follow clean code principles
  • Your code should pass all the provided unit tests
  • You should use Git for version control and include meaningful commit messages
  • Your report should be as comprehensive as possible

Submission

  1. Add your mentor as a contributor to the project.
  2. Create a develop branch for implementing features.
  3. Use Git for regular code commits.
  4. Push your code and your report to the remote repository.
  5. Submit a pull request to merge the develop branch with main.

The deadline for submitting your code is Friday, May 17 (28th of Ordibehesht). Good luck!