ECE472/572 (UCLX) Assignment 3

Prepare for the lab

Answer these questions while doing this lab – they will help you understand the procedure and better prepare for the tests.

Activity (30pts. and up)

Consider the pair of programs for Posix style pipes that is posted in the programming examples section: Named Pipes in Posix - sender and Named Pipes in Posix - receiver, and also a pair of programs for Posix style shared memory: Named Shared memory server in Posix and Named Shared memory client in Posix.

Do the following experiment in a dedicated folder created inside your Ubuntu Linux account. Regardless from the version you choose you are still responsible for studying both communication by pipes and by shared memory in order to prepare for the upcoming quiz and test.

45pts. Version

Write a pair of programs called ONE.c and TWO.c that would use both technologies, one area of shared memory and two named pipes to communicate between each other in the way described below.

Simplified 30 Pts. Version

Write a set of three programs called ONE.c, TWO.c and THREE.c that would use the total of two named pipes to communicate ONE to TWO and TWO to THREE. Run them simultanously in three terminals. The first program shall ask user to enter text, one line at a time and send it through a pipe to the program TWO. The program TWO shall receive the text from the program ONE and immediately resend it to the program THREE without displaying it on the screen. The program THREE shall receive the the text from the program TWO and immeidately display it to the console screen. The program ONE is ready to exit when a user enters an empty line. The program ONE shall send that empty line to program TWO to indicate that it shall exit as well but only after the message is resent to program THREE so that it can exit as well.

Proof of Work

In order to test your work: open terminal windows for each compiled program. Rearrange the windows so that you could see each of them. Go to the same folder in each of the terminals. Compile the programs; you may do all fo them from one of the terminals. Run your programs, one in each terminal. Type lines from keyboard into the first program. Observe the same text appearing in the last program. Capture the computer screen of your programs running and save as screen.png file into the same folder.

Pack your folder with program source files and compiled binary files using tar and then gzip. Remember to execute tar from outside of that folder! Consider how to perform both tar and gzip on one compound command line. Consider how the grader would unpack the files using command line utilities.


Drop off the produced .TGZ file in the corresponding assignment drop box on Sakai.

Thank you.

web site front local main page local list page general bookmarks software bookmarks go back copyright info