In this assignment, you are given three problems focused on various areas of multithreaded programming. Solve each exercise according to the provided guidelines.
- 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
-
Fork this repository and clone the fork to your local machine. Ensure to create a new Git branch before starting your work
-
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 thePiCalculator
class.Semaphore
: Solve a synchronization problem using a Semaphore that allows 2 threads to enter the critical section. Find more instructions in theController
class.
-
Write a comprehensive report on the assignment.
- 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.
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.
- 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
- Add your mentor as a contributor to the project.
- Create a
develop
branch for implementing features. - Use Git for regular code commits.
- Push your code and your report to the remote repository.
- Submit a pull request to merge the
develop
branch withmain
.
The deadline for submitting your code is Friday, May 17 (28th of Ordibehesht). Good luck!