Project 4 -- Inter-Process Communication (IPC)

Corrected

Electronic Copy Due Thursday, December 8, 1:00 pm

Hard Copy Due Thursday, December 8, 1:30 pm

(Note that due date is later than originally listed in the class schedule.)

NOTE: This assignment, like the other projects in this class, is due at a particular time, listed above. This means that if you are even a minute late, you lose 20%. If you are worried about potentially being late, turn in your project ahead of time. Do this by submitting it electronically before it is due and giving the hard copy to me during office hours or by sliding it under my office door before it is due. Do not send assignments to my personal email address. Do not leave hard copies in my departmental mail box or attempt to give them to departmental staff (who cannot and will not accept them).

In Projects 2 and 3, you took the first two steps toward the development of a graphical PDF browser by making use of existing software, such as an image conversion tool, a web browswer, and file unpackaging software as components of gbPDF and gbPDF2.

However, while gbPDF2 had the functionality we were looking for, the components weren't as well integrated as they could have been. This is because while gbPDF and gbPDF2 made use of other programs to do some of the work, their communications with those programs was quite limited. The only communication came through parameters passed to those programs when they were called and the SIGCHLD signals and exit status codes generated by those programs when they exited. This meant there was no communication between these helper programs and gbPDF or gbPDF2 while they were actually running.

In this assignment, you will take the third step toward the development of a graphical PDF browser by adding some integration through inter-process communication (IPC). To keep the assignment simple, you will only add a tiny bit of IPC, and therefore a tiny bit of integration. This is only the third step, since we would need a lot more work on integration to make such a graphical PDF browser fully integrated (particularly since web browser developers these days do not seem to understand IPC) and you are not assigned the job of creating a nice GUI front end for your graphical PDF browser. Still, it will let you gain experience with the basic mechanisms for dealing with inter-process communication.



The Assignment

You are to create a program called gbPDF3. When run, gbPDF3 will behave from the user's perspective just as described for gbPDF2 in Project 3. The big difference will be behind the scenes. For Project 4, gbPDF3 will learn with which files are extracted from a package by reading from a pipe, rather than reading from a directory, and will learn which files are created by convert by reading from a pipe, rather than reading from a directory.

For implementing this functionality, you must use appropriate POSIX system calls directly, rather than higher level functions (such as popen).

What to Turn In

You will turn in both a hard copy and an electronic copy of your assignment. Electronic copies must be submitted to the appropriate drop box in D2L for the course. Do not send them to my email address.

Both the hard copy and the electronic copy will contain a cover sheet documenting group membership and contributions (see below), all source code you created for gbPDF3, and a write-up of 1/2 to 1 page (roughly 80 characters per line, 50 lines per page) explaining the data structures and algorithms used in your code. This page limitation does not include figures used in your explanations, which are encouraged and may take up any amount of space. (The explanations do not remove the requirement that your code be well commented.)

The electronic copy will also contain an executable for gbPDF3 which should be called gbPDF3.

Your source code should be well structured and well commented. It should conform to good coding standards (e.g., no memory leaks).



Other

You may write your program from scratch or may start from programs for which the source code is freely available on the web or through other sources (such as friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original or changed, and which you got from which other source. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly.

As noted in the syllabus, you are required to work on this programming assignment in a group of at least two people. It is your responsibility to find other group members and work with them. The group should turn in only one (1) hard copy and one (1) electronic copy of the assignment. Both the electronic and hard copies should contain the names and student ID numbers of all group members. If your group composition changes during the course of working on this assignment (for example, a group of five splits into a group of two and a separate group of three), this must be clearly indicated on your cover sheet (see below), including the names and student ID numbers of everyone involved and details of when the change occurred and who accomplished what before and after the change.

Each group member is required to contribute equally to each project, as far as is possible. Your cover sheet must thoroughly document which group members were involved in each part of the project. For example, if you have three functions in your program and one function was written by group member one, the second was written by group member two, and the third was written jointly and equally by group members three and four, your cover sheet must clearly indicate this division of labor.

Note that all personally identifying information (names, student ID numbers, 4x4s, etc.) must only be included on the cover sheet and nowhere else in the project materials.