This project is a C# Windows Forms–based School Management System designed with a strong focus on Operating System concepts, particularly concurrency control, race condition handling, deadlock prevention, and synchronization mechanisms.
The system demonstrates how real-world software systems can safely manage shared resources using Semaphores, Mutexes, and Monitors, ensuring data consistency and system reliability in a multi-threaded environment.
- Design a complete School Management System using C# Windows Forms
- Identify and resolve race conditions in database operations
- Prevent deadlocks during concurrent access
- Implement OS synchronization techniques
- Demonstrate practical usage of Semaphore, Mutex, and Monitor
- Ensure thread-safe database transactions
- Race Conditions
- Deadlocks
- Critical Section conflicts
- Resource starvation
| Technique | Usage |
|---|---|
| Semaphore | Controls access to limited shared resources |
| Mutex | Ensures exclusive access to critical sections |
| Monitor (lock) | Provides structured mutual exclusion |
| Transactions | Ensures atomic database operations |
- Prevents duplicate subject assignment
- Handles concurrent insert/delete requests safely
- Thread-safe add, update, and delete operations
- Cascading delete handled using transactions
- Synchronization prevents inconsistent deletions
- Ensures one teacher per subject per class
- Prevents race conditions during assignment
- Thread-safe result entry
- Prevents duplicate grading records
- Atomic calculation and insertion of results
- Prevents teacher scheduling conflicts
- Ensures consistent slot allocation
- Handles concurrent timetable updates safely
lock (teacherLock)
{
// Critical Section:
// Check duplicate → Insert teacher
}This ensures that only one thread can modify teacher records at a time, preventing race conditions.
🛠 Technologies Used Language: C#
Framework: .NET (Windows Forms)
Database: SQL Server
IDE: Visual Studio
Architecture: Layered (DAL + UI)
📂 Project Structure
School_Management_System/
│
├── DAL/
│ ├── TeacherDAL.cs
│ ├── StudentResultDAL.cs
│ ├── TimetableDAL.cs
│ ├── ClassSubjectsDAL.cs
│ └── TeacherCoursesDAL.cs
│
├── Models/
│ ├── Teacher.cs
│ ├── StudentResultclass.cs
│ ├── Timetableclass.cs
│ └── ...
│
├── Forms/
│ ├── TeacherForm.cs
│ ├── StudentResultForm.cs
│ ├── TimetableForm.cs
│ └── ...
│
├── DBConnection.cs
└── README.md
🚀 How to Run the Project Clone the repository:
git clone https://github.com/talhadeveloperr/ConcurrencySafe-School-Management-System.git
Open the solution in Visual Studio
Configure SQL Server connection string in DBConnection.cs
Restore database tables
Run the project
📊 Key Learning Outcomes Practical implementation of mutual exclusion
Real-world handling of deadlocks and race conditions
Understanding critical sections in database-driven applications
Applying OS theory to real software systems
📌 Future Enhancements Role-based authentication
Async database operations
Logging and monitoring for thread behavior
Performance benchmarking under heavy load