Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThreadSafe-VFS

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

Features

  • Custom Memory Allocator

    • 50 MB memory pool
    • 4 KB page allocation
  • Virtual Memory

    • Swaps pages to swap.sys when RAM is exhausted
    • Simulates page faults
  • 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

Project Structure

ThreadSafe-VFS/
├── main.cpp
├── MemoryAllocator.h
├── Swapper.h
├── DeadlockDetector.h
├── VFS.h
├── README.md
├── LICENSE
└── .gitignore

Build

g++ -std=c++17 main.cpp -pthread -o ThreadSafe-VFS

Run

./ThreadSafe-VFS

Concepts Demonstrated

  • Operating Systems
  • Memory Management
  • Paging
  • Swapping
  • LRU
  • Synchronization
  • Shared Mutex
  • Deadlock Detection
  • Multithreading

Future Improvements

  • Restore actual page data from swap file.
  • Directory hierarchy.
  • File permissions.
  • Better swap metadata.
  • Real page table implementation.

Author

Abhinav

About

A multithreaded Virtual File System (VFS) developed in C++17 with a custom memory allocator, LRU-based virtual memory paging, reader-writer synchronization, and background deadlock detection.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages