Skip to content

GitHub repository featuring Operating System code: Banker's algorithm, Peterson solution, multi-threaded chat server, fork for if-else, sum, and sorting, CPU scheduling, semaphore, reader-writer problem, sleeping TA (pizza delivery), process synchronization, dining philosophers, thread and mutex in matrix, and producer-consumer implementation.

Notifications You must be signed in to change notification settings

mehzabin-haque/Operating_System

Repository files navigation

Operating System Algorithms and Concepts

Introduction

Welcome to the Operating System Code Repository! This GitHub repository showcases various fundamental operating system algorithms and concepts implemented in C++. These code examples aim to provide insights into how these algorithms work and their relevance in handling different scenarios.

Algorithms and Concepts Included

Deadlock Avoidance and Detection

  1. Banker's Algorithm: Implementation of the Banker's algorithm for deadlock avoidance in resource allocation.
  2. Peterson's Solution: Code for Peterson's algorithm used for synchronization and mutual exclusion.

Multi-Threaded and Chat Server

  1. Multi-Threaded Chat Server: Implementation of a chat server that supports multiple clients concurrently using threads.

Fork and Process Synchronization

  1. Fork Usage - If-Else, Sum, and Sorting: Examples demonstrating the use of fork for different tasks such as conditional execution, summing numbers, and sorting.
  2. CPU Scheduling: Implementation of CPU scheduling algorithms like Round Robin, Shortest Job First (SJF), etc.
  3. Semaphore: Code for using semaphores to synchronize processes and manage shared resources.
  4. All Reader-Writer Problems: Solving various reader-writer problems with different solutions.

Sleeping TA and Pizza Delivery

  1. Sleeping TA: Concept applied to simulate a scenario of students waiting for a Teaching Assistant (TA) while the TA sleeps until a student arrives.
  2. Pizza Delivery: A practical application of the Sleeping TA concept in the context of pizza delivery, where customers place orders and delivery agents process them.

Process Synchronization and Dining Philosophers

  1. Process Synchronization: Implementations of different process synchronization mechanisms to manage concurrent access to shared resources.
  2. Dining Philosophers: Solving the classic dining philosophers problem with different solutions.

Thread and Mutex in Matrix Operations

  1. Thread and Mutex Usage in Matrix Operations: Examples showcasing the usage of threads and mutex to perform matrix operations concurrently.

Producer-Consumer Problem

  1. Producer-Consumer Problem: Implementation of the producer-consumer problem using threads for concurrent production and consumption.

Usage

Users can compile and run the provided C++ code to observe the working of each algorithm and understand how operating system concepts are applied in practice.

Contributions

Contributions to this repository are encouraged. If you wish to add more operating system algorithms or enhance existing ones, please feel free to submit a pull request.

About

GitHub repository featuring Operating System code: Banker's algorithm, Peterson solution, multi-threaded chat server, fork for if-else, sum, and sorting, CPU scheduling, semaphore, reader-writer problem, sleeping TA (pizza delivery), process synchronization, dining philosophers, thread and mutex in matrix, and producer-consumer implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published