Giter Site home page Giter Site logo

piper's Introduction

"Advanced Topics in Operating Systems"

M.Sc. course at the Reichman University
Lecturer and guide - Dr. Oren Laadan

piper

This program is a part of our 1st assignment
Check out piper/assignment-1.md for full details of the assignment
This program is only the invidual part, and the group part will be commited in dtrugman repo, at the following link - https://github.com/dtrugman/linux-hw1-os

Invidual Part - Part A

For full answer (which is the actual code) - check out the code at piper/main.c
The main purpose was to write a program that takes a series of program names as arguments,
and executes them as piped command, e.g. ps aux | grep "init"

Invidual Part - Part B

In part B, we were asked to consider the command ps aux | grep pizza-margarita. "Assuming that at the time of executing this command, there isn't any process with that name in the system - what would be the expected out of this command? Explain why, based on your experience in writing piper."

As we learned, pipe commands run in parallel. In that case, we cannot guarantee which command will eventualy run first.
Actually, it's a matter of details of the workings of the shell combined with scheduler fine-tuning deep in the bowels of the kernel .
The shell first creates the pipe, the "conduit" for the data that will flow between the processes, and then creates the processes with the ends of the pipe connected to them.
The first process that who run may block waiting for input from the second process, or block waiting for the second process to start reading data from the pipe.
In eventualy, the data gets transfered and everything works just fine, as we mentioned before, no matter which command ran first.

When you run the useage ps aux | grep "pizza-margarita" or any other string followed by the grep, assuming that the is no process running with that name in the system, we should receive an output with the details of the actual grep process, including the string followed by.

E.g. with pipeline command and the followed outputs:

imag <br/>e

piper's People

Contributors

glaichen avatar

Stargazers

 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.