Skip to content

This repository contains implementations of various operating system scheduling algorithms in C++. Whether you're a student studying operating systems or a developer looking to understand these algorithms better, this repository aims to provide clear and concise implementations along with explanations to aid your learning.

Notifications You must be signed in to change notification settings

Pulkit1822/CSE3003-Operating-System

Repository files navigation

CSE3003 - Operating System

Welcome to the CSE3003 - Operating System Repository! This repository contains implementations of various OS algorithms in C++. Whether you're a student studying OS or a developer looking to understand these algorithms better, this repository aims to provide clear and concise implementations along with explanations to aid your learning.

Result

Here are my scores: Result

What is this project all about?

This project is a comprehensive collection of various Operating System (OS) algorithms implemented in C++. It aims to provide a clear understanding of these algorithms through well-documented code and explanations. The repository is designed to be a valuable resource for students, developers, and anyone interested in learning about OS algorithms.

How is this project made?

This project is made using C++ programming language. Each algorithm is implemented in its own directory with a corresponding README file that explains the algorithm's logic and how to use the implementation. The project uses standard C++ libraries and follows best practices for coding and documentation.

What makes this project the best?

This project stands out due to its comprehensive coverage of various OS algorithms, clear and concise code implementations, and detailed explanations. Each algorithm is implemented in a way that is easy to understand and follow, making it an excellent learning resource. The project also includes example usage and code analysis sections for each algorithm, providing a deeper understanding of how the algorithms work.

How is it better?

Compared to similar projects, this repository offers a more detailed and structured approach to learning OS algorithms. The code is well-documented, and each algorithm is accompanied by a README file that explains the logic and usage. This makes it easier for users to understand and experiment with the algorithms. Additionally, the project covers a wide range of OS algorithms, providing a comprehensive learning resource.

What new technology has been used?

This project leverages the C++ programming language and standard libraries to implement the OS algorithms. It also uses modern C++ features and best practices to ensure the code is efficient, readable, and maintainable. The project is designed to be easily extensible, allowing users to add new algorithms or modify existing ones.

How to run this project?

To run this project, follow these steps:

  1. Clone the repository to your local machine using git clone https://github.com/Pulkit1822/CSE3003-Operating-System.git.
  2. Navigate to the directory of the algorithm you want to run.
  3. Follow the instructions provided in the README file of the respective algorithm to compile and run the code.
  4. Experiment with different inputs and configurations to observe the behavior of the algorithm.

Contribution guidelines

Contributions to this repository are welcome and encouraged. If you would like to contribute:

  1. Fork the repository and create your branch from main.
  2. Ensure any new code is well-documented and follows the established coding style.
  3. Create a pull request with a clear description of your changes and their rationale.

Algorithms Implemented

  1. Round Robin Scheduler: This algorithm is a preemptive scheduler where each process is assigned a fixed time slice or quantum. Once a process consumes its quantum, it's moved to the back of the ready queue to await its turn again. This implementation demonstrates how round-robin scheduling can be achieved efficiently in C++.

  2. Priority Scheduler: Priority scheduling assigns priorities to each process, and the CPU is allocated to the process with the highest priority. In case of ties, a round-robin approach can be used. This implementation showcases how to implement priority scheduling and handle priorities effectively.

  3. Shortest Job First (SJF): SJF scheduling algorithm selects the process with the smallest execution time next. This implementation demonstrates how to implement SJF scheduling in C++.

  4. First-Come, First-Served (FCFS): FCFS scheduling algorithm executes processes in the order they arrive in the ready queue. This implementation demonstrates how to implement FCFS scheduling in C++.

  5. Inter Process Communication - Semaphore:

  • Semaphore: It demonstrates the implementation of semaphores for synchronization in a producer-consumer scenario. It creates a semaphore, allows the producer to produce items, and the consumer to consume them from a shared buffer. Semaphores are used to control access to the buffer and ensure proper synchronization between the producer and consumer processes.

  • Producer-Consumer Problem: It illustrates the classic producer-consumer problem using semaphores for synchronization. It sets up a shared buffer where the producer produces items and the consumer consumes them. Semaphores are employed to coordinate access to the buffer, preventing race conditions and ensuring orderly item production and consumption between the two processes.

  1. Banker's Algorithm: The Banker's Algorithm in OS is a resource allocation and deadlock avoidance algorithm. It helps prevent deadlock conditions by ensuring that resource allocation does not lead to a deadlock. The algorithm is based on the concept of a bank, where the bank never allocates more resources than what is available. It checks whether granting resources would lead to a deadlock and only grants resources if it would not result in a deadlock. It is mainly used to prevent deadlock.

  2. Resource Allocation Graph: The Resource Allocation Graph (RAG) is a graphical representation that provides information about the state of the system in terms of processes and resources. It shows which resources are held by which processes and can help identify deadlocks. The vertices in a RAG represent processes and resources, with processes typically represented by circles and resources by rectangles. The edges in a RAG represent assignments (resources assigned to processes) and requests (processes waiting for resources). If there is a cycle in the RAG, it indicates a deadlock.

How to Use

Each algorithm implementation is contained within its own directory along with a README file explaining the algorithm's logic and how to use the implementation. To use any algorithm:

  1. Navigate to the respective algorithm's directory.
  2. Follow the instructions provided in the README to compile and run the code.
  3. Experiment with different inputs and configurations to observe the behavior of the algorithm.

Contribution Guidelines

Contributions to this repository are welcome and encouraged. If you would like to contribute:

  1. Fork the repository and create your branch from main.
  2. Ensure any new code is well-documented and follows the established coding style.
  3. Create a pull request with a clear description of your changes and their rationale.

Feedback

If you have any feedback, suggestions, or questions regarding this repository, please feel free to open an issue or contact me below on any of the platforms you prefer 😊

portfolio    Linkedin Logo    Gmail logo    Instagram Logo    Pinterest Logo    Twitter Logo   

Happy learning and coding!


If you find this repository useful, don't forget to star it! ⭐️

Written by Pulkit

About

This repository contains implementations of various operating system scheduling algorithms in C++. Whether you're a student studying operating systems or a developer looking to understand these algorithms better, this repository aims to provide clear and concise implementations along with explanations to aid your learning.

Topics

Resources

Stars

Watchers

Forks

Languages