A multithreaded Virtual File System (VFS) simulator written in C++ that demonstrates several Operating System concepts, including:
- Custom Memory Allocation
- Virtual Memory (Paging)
- Swapping (LRU Page Replacement)
- Reader-Writer Synchronization
- Deadlock Detection
- Multithreading
-
Custom Memory Allocator
- 50 MB memory pool
- 4 KB page allocation
-
Virtual Memory
- Swaps pages to
swap.syswhen RAM is exhausted - Simulates page faults
- Swaps pages to
-
Reader-Writer Locks
- Multiple readers can access a file simultaneously.
- Writers obtain exclusive access.
-
Deadlock Detection
- Wait-for graph
- DFS cycle detection
- Background daemon thread
ThreadSafe-VFS/
├── main.cpp
├── MemoryAllocator.h
├── Swapper.h
├── DeadlockDetector.h
├── VFS.h
├── README.md
├── LICENSE
└── .gitignore
g++ -std=c++17 main.cpp -pthread -o ThreadSafe-VFS./ThreadSafe-VFS- Operating Systems
- Memory Management
- Paging
- Swapping
- LRU
- Synchronization
- Shared Mutex
- Deadlock Detection
- Multithreading
- Restore actual page data from swap file.
- Directory hierarchy.
- File permissions.
- Better swap metadata.
- Real page table implementation.
Abhinav