Project 4 -- Inter-Process Communication (IPC)

Due Thursday, December 1, 9:00 pm

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 the due date (the electronic copy is what is due by the time given above) then giving the hard copy to me or the TA during office hours or by sliding it under my office door (the hard copy is due within twenty-four hours after the electronic copy is due). Do not send assignments to my personal email address or to the personal email address of the TA. 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).

As discussed in class, the software you will create for Project 3 may make use of temporary files to pass data from the gradesend program to an email program of your choice. While this is a workable approach, it does require available disk space, names for temporary files, clean up to remove files that are no longer needed, caution to ensure that temporary files are not inappropriately accessible by other means, and effort to deal with the possibility that the program will end before the temporary files are properly removed.

An alternative to temporary files is to use Inter-Process Communication (IPC) of some type or other. This can remove many or all of the requirements listed above for the use of temporary files. For Project 4, you will take the IPC approach.



The Assignment

You are to create a program called gradesend2. When run, gradesend2 will act exactly as did gradesend from Project 3, with one possible exception: gradesend2 will create no temporary files. (This is only a possible exception, as the instructions for Project 3 allow you to write gradesend in such a way that it also uses IPC rather than temporary files. If you have chosen to use IPC for Project 3, then you can turn in the same source code and executable for both Project 3 and Project 4.)

Other than the fact that no temporary files are allowed for gradesend2 in Project 4, all of the requirements and options for gradesend in Project 3 are retained, including message contents, ordering of message creation and transmission, use of an email program to actually send the email, use of fork(), exec(), and wait(), explanations of your choices in the writeup, form of the call, and user output (including error messages).

Additionally, you will need to include in your writeup an explanation for which IPC method you chose to use for gradesend2.



Notes on this assignment

You should not expect the csv files (either the original or the reduced version with just your scores) to be very understandable with a text editor or pager. Instead, you should be able to import it back into OpenOffice and view it that way.



What to turn in.

You will turn in both a hard copy and an electronic copy of your assignment. Please follow the instructions on how to send electronic copies. Do not send them to my email address.

Both the hard copy and the electronic copy will contain a write-up plus the source code for gradesend2. The electronic copy will also contain the executable of gradesend2. The electronic copy of your write-up should not be in a proprietary format (such as MS Word); it should be either in plain ASCII text or in a portable format (such as Postscript or PDF). Your source code for gradesend2 should be in a single file called gradesend2.c or gradesend2.cxx and your executable code should be called gradesend2.

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

Your write-up will include 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.)



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 in your write-up, 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. You 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, both your write-up and the comments in your code must clearly indicate this division of labor.