Theorical questions updated
This commit is contained in:
@@ -8,10 +8,14 @@ This assignment is divided into two main sections:
|
||||
<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.
|
||||
|
||||
---
|
||||
|
||||
## 🧠 Theoretical Questions
|
||||
|
||||
**Note**:
|
||||
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 (non‑atomic) variables.
|
||||
|
||||
@@ -30,6 +34,7 @@ Write your answers in a Markdown file (e.g. Answers.md) and place it in the root
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
## Practical Assignment 💻
|
||||
|
||||
|
||||
Reference in New Issue
Block a user