Dev #3

Merged
Aryan merged 22 commits from dev into main 2026-06-05 20:30:51 +00:00
Showing only changes of commit 1df0d7b721 - Show all commits
+5
View File
@@ -8,10 +8,14 @@ This assignment is divided into two main sections:
<br> <br>
<br> <br>
- **Practical Project**: You are asked to implement a banking system that performs concurrent operations using multithreading. The main goal of the exercise is handling deadlocks and race conditions so that the program performs correctly. - **Practical Project**: You are asked to implement a banking system that performs concurrent operations using multithreading. The main goal of the exercise is handling deadlocks and race conditions so that the program performs correctly.
--- ---
## 🧠 Theoretical Questions ## 🧠 Theoretical Questions
**Note**: **Note**:
Write your answers in a Markdown file (e.g. Answers.md) and place it in the root directory of your forked repository. Write your answers in a Markdown file (e.g. Answers.md) and place it in the root directory of your forked repository.
--- ---
**1-** What are atomic variables? Explain their purpose and how they differ from ordinary (nonatomic) variables. **1-** What are atomic variables? Explain their purpose and how they differ from ordinary (nonatomic) variables.
@@ -30,6 +34,7 @@ Write your answers in a Markdown file (e.g. Answers.md) and place it in the root
**2-** **2-**
Write a small Java program that concurrently increments a normal int variable and an AtomicInteger variable from multiple threads. Print the final values of both variables to demonstrate that the atomic variable produces the correct result, while the normal variable may show an inconsistent value due to a race condition. Write a small Java program that concurrently increments a normal int variable and an AtomicInteger variable from multiple threads. Print the final values of both variables to demonstrate that the atomic variable produces the correct result, while the normal variable may show an inconsistent value due to a race condition.
--- ---
## Practical Assignment 💻 ## Practical Assignment 💻