Git Product home page Git Product logo

os-programming-concepts's Introduction

OS Programming Concepts

The repository contains examples of operating system programming concepts, e.g. threading, synchronization, and inter-process communication. Made for the Operating Systems with System Programming (IDATA2305) course, spring 2022.

These projects are mandatory but do not count towards the final grade in the subject.

Java CI with Maven

Contents

  • Write a multithreaded program in Java that calculates the required statistical values from the given list of numbers.
  • Create at least 4 worker threads:
    • Thread to determine the average of the given numbers.
    • Thread to determine the minimum value.
    • Thread to determine the maximum value.
    • Thread to determine the standard deviation.
  • Output the values from the parent thread once the workers have exited.
  • Present a solution to this classic synchronization problem using Java and Java's "Monitor" synchronization mechanism.
    • 5 philosophers are sitting at a round table with a large bowl of spaghetti doing one of three things: eating, thinking, or sleeping.
    • There are 5 chairs, 5 plates, and 5 forks.
    • Philosophers don’t speak with each other.
    • A philosopher must eat with two forks, one for each hand.
    • Each time a philosopher has finished eating, he will drop his forks and start thinking.
    • When a philosopher is done thinking, he will become hungry again.
    • Philosophers can not starve or die in this version of the problem.
  • Create a simple Java application that:
    • Uses a shared buffer of fixed size 5.
    • Has a producer thread that puts 10 data items into the buffer.
    • Has a consumer thread that gets all 10 data items from the buffer.
    • Handle the case of buffer full/empty.
    • Use Java's "Monitor" to synchronize the consumer and producer.
  • The buffer size of 5 makes the buffer to small to fit all 10 data items and the solution must take necessary steps to secure that the producer can not produce more items if the buffer is full. The consumer on the other hand must not try to consume data from the buffer if the buffer is empty.
  • Write a multi-threaded application in Java and use Java's "Monitor" for synchronization.
  • Barber shop has one barber, one barber chair, and 5 chairs for waiting customers.
    • If there are no customers, the barber sleeps in his own chair.
    • When a customer arrives, he has to wake up the barber.
    • If there are many customers and the barber is cutting a customer’s hair, then the remaining customers either wait if there are empty chairs in the waiting room or they leave if no chairs are empty.

os-programming-concepts's People

Contributors

marko19907 avatar

Watchers

 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.