Skip to content
/ piper Public

1st assignment at "Advanced Topics in Operating Systems" course

Notifications You must be signed in to change notification settings

GlaiChen/piper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

"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

About

1st assignment at "Advanced Topics in Operating Systems" course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages