GithubHelp home page GithubHelp logo

eis-assignment's Introduction

EIS assignment

Problem 1:

Write a program which will create n process. show that the processes will run asynchronously on CPU (i.e. there is no specific order in which the process are scheduled on the CPU).

answer1.png


Problem 2:

Demonstrate the Creation of a Zombie process and also show that the zombie process can be prevented.

A) Zombie process created:

answer2a.png


B) Zombie process is prevented:

answer2b.png


Problem 3:

Write a program which creates, say 10 process. Let them run in an infinite loop. show that the processes are scheduled on the CPU in no specific order.

answer3.png


Problem 4:

Show that a user level thread blocks the entire process when it calls a blocking system call.

answer4.png


Problem 5:

Give a solution to the bounded buffer producer and consumer problem using semaphore. The buffer should implement in a shared memory. Producer and consumer should be two distinct processes. The buffer state at different times should be captured in a text file or in a graphical representation.

answer5.png


Problem 6:

Create two shared libraries A.so (contains the function definition of factorial) and B.so (containing the function ifprime). Link these libraries dynamically to your executable where factorial and ifprime function is used and demonstrate that a shared library is loaded into memory only when dlopen is called and offloaded from memory when dlclose called for that library. Also, do the same as above creating archives libraries A.a and B.a. Show that the size of executable in this case more than the size of executable in the earlier case.

A) Dynamically linked the libraries (.so) to the main program:

answer6a.png


B) Built executable using the archive libraries (.a) made from individual libraries:

answer6b.png


Problem 7:

A) Create a pipe between a parent and its child and send data down the pipe. With proper example.

answer7a.png


B) Create two pipes before the fork, to implement interprocess communication between parent and child.

answer7b.png


C) Implement an IPC (or two half-duplex pipes), such that the coprocess add2 is invoked when two numbers are read from standard input and the value from the co-process is written to its standard output.

answer7c.png


Problem 8:

A.1) The Producer/Consumer Problem.

answer7c.png


A.2) Barber customer problem.

answer7a.png


B) Readers/Writers Problem using Semaphore /Monitors.

answer7b.png


C) Dining Philosophers Problem using semaphores/monitors.

answer7c.png


D) Dekker’s algorithm / Peterson’s algorithm.

answer7c.png

eis-assignment's People

Contributors

shambu09 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.