Code Monkey home page Code Monkey logo

context-switching's Introduction

Context-Switching

A multithreaded simulation of the process switching mechanism in operating systems. This was my project in "Operating Systems" course.

Simulation of the process switching mechanism with custom instruction set. The context of the processes was saved enabling processes to resume execution from the last saved state.

Usage:

  1. Open bash and type in the commands specified below.

  2. These commands should be typed without double quotes.

    gcc -pthread -o "executable_name" launchMain.c
    ./"executable_name"

Description of files:

  1. opcode.txt - Each line contains the operation code and is integer representation separated by a space.
  2. variables.txt - Each line contains the name of the variable and its current value.
  3. processes/filein_(1/2/3/4/5).txt - Each file contains a set of instructions.
    The instruction format is as follows:
    opcode operand1 operand2 result_variable

Results: Based on the option chosen by you during the execution of "launchMain.c", logs will be stored in in 2 different files.

  1. Implementation with threads -> logs_rr_with_thread
  2. Implementation without threads -> logs_rr_without_thread

For more information about the project, please refer to the document 'OS_Project_Context_Switching.pdf'.

context-switching's People

Contributors

hvudeshi avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.