Skip to content

Commit 4819ae9

Browse files
Updated README.md
1 parent b3e1836 commit 4819ae9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lab09/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,37 @@
22
Laboratory 09 of the Operating Systems course of the master degree in Embedded System (Electronic Engineering) of Politecnico di Torino, academic year 2019/2020.<br/>
33

44
## Exercise 1
5+
Write a multi-process program that evaluates the following math series:
6+
7+
<p align="center">
8+
<img src=
9+
"https://render.githubusercontent.com/render/math?math=%5Cdisplaystyle+%5Csum_%7Bi%3D1%7D%5E%7BN%7D+%5Cfrac%7Be%5Ei%7D%7Bi%7D%0A"
10+
alt="\sum_{i=1}^{N} \frac{e^i}{i}
11+
">
12+
13+
The main process receives the N value as input (set max value for N to 10) and performs the final sum.
14+
The i-th process evaluates its internal term and sends the result to the father through a pipe.
15+
Please notice that each internal term generates a floating value.
16+
17+
Hint: please notice that the read function is, by default, a blocking function: if there are no (enough) data to be read, the reading process is moved to the waiting state.
18+
In this configuration, there is no 0 byte read return to check: a 0 / less than 0 value means error during the read operation!
519

620
## Exercise 2
21+
Write a modified Linux shell based on a client/server architecture where the client shares with the server a sequence of strings, using a FIFO.
22+
The server scans the content of every string and, as soon as the string is equal to "house" or "casa", it prints the message "house detected".
23+
If the string contains the string "exit" both client and server must terminate.
24+
25+
Hint: remember that the FIFO can be defined and shared among processes by referring to the same fifo name, thus you do not need to fork the process but you must write two different programs: the server and the client.
26+
Run the server before the client.
727

828
## Exercise 3
29+
Write a program that creates 10 child processes. The creating process has to:
30+
- Display their ID and prompt the user to choose the process that has to end.
31+
- Signal the end of the requested process through the SIGQUIT signal.
32+
- Re-print the list of remaining open process IDs and prompts the user to choose a process to end.
33+
34+
Each child process has to:
35+
- Manifest itself every X random seconds (between 1 and 10) by printing some messages including its ID.
36+
- The main program ends when all processes terminate.
37+
38+
[//]: # (https://tex-image-link-generator.herokuapp.com/)

0 commit comments

Comments
 (0)