UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
Operating Systems II
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Vasileios Mamalis, Professor
Co-supervisor: Nikolaos Psarras, Applications Lecturer
Athens, April 2022
This repository contains an assignment for Operating Systems II, focusing on process creation, management, and synchronization in C using fork() and wait() system calls.
| Section | Folder/File | Description |
|---|---|---|
| 1 | assign/ |
Assignment material for the Fork processes workshop |
| 1.1 | assign/ASK-1-OS-II-LAB-2021-22.pdf |
Assignment description in English |
| 1.2 | assign/ΕΡΓ-1-ΛΣ-ΙΙ-ΕΡΓ-2021-22.pdf |
Assignment description in Greek |
| 2 | docs/ |
Documentation covering process creation using fork |
| 2.1 | docs/Fork-Processes.txt |
English documentation for fork processes |
| 2.2 | docs/Fork-Διεργασίες.txt |
Greek documentation for fork processes |
| 3 | src/ |
Source code demonstrating fork usage |
| 3.1 | src/exer1a.c |
Exercise source code using fork |
| 3.2 | src/fork.c |
Basic fork process example |
| 4 | README.md |
Repository overview and usage instructions |
The assignment involves developing a C program that:
- Creates a total of seven processes following a specific hierarchy.
- Implements process synchronization to avoid zombie processes.
- Demonstrates inter-process communication.
- Explores scenarios with orphan and zombie processes.
- Allows process P2 to spawn N child processes dynamically based on user input.
- Understand and apply
fork()andwait()system calls. - Create and manage process hierarchies.
- Synchronize parent and child processes effectively.
- Handle inter-process communication and message passing.
- Investigate orphan and zombie processes and prevention techniques.
The program creates processes with the following hierarchy:
(P0)
/|\
/ | \
/ | \
/ | \
/ | \
(P1) (P3) (P4)
/ |
/ |
/ |
/ |
(P2) (P5)- Operating System: Linux or Unix-like environment
- Compiler: GCC (GNU Compiler Collection)
- System Calls:
fork(),wait(),execv(), and others as needed
git clone https://github.com/Operating-Systems-2-aka-Uniwa/Fork.git
cd Forkgcc -o exer1a exer1a.c
gcc -o fork fork.c./exer1a
./fork