Islamic University of Gaza
Faculty of Engineering
Computer Engineering Department
Operating System Lab
Lab 9
"IPC using Shared Memory"
Prepared By
Mohammed Ayman Khader
120191065
Supervisor
Eng. Anas al_baba.
9th DEC, 25
Task1:
The first code have created a shared memory segment in some place on main memory,
and had did attach it to its own address space as shown in the figure.
Task2:
The second it is not very different from the first one except that is getting the shared
memory created before. And attaching to it.
Task3:
This code has wrote all English letters from a to z, and waits until a second process
change the first letter to ‘*’
Task4:
This code has used fork () function, the child waits for its parent to create a shared
memory segment and attaching to it, and then is writing ‘a’ to ‘z’ then detaching.
After the parent exited, now the child will begin It will get that shared memory segment
and doing attach to it, and prints all letters.
Task5:This code have three processes, process 1 waits for process 2 to do some task,
and process 3 to do some one as well. I have added “still” in the loop to emphasis
Process 1
Process 2:
Process3: