Programming Assignment 3

Version 1.0 - Initial release

Colorado State University

CS370: Operating Systems


DUE DATE:
10:00 pm
Sunday April 20th, 2014


Programming Assignment 3: Semaphores galore

The purpose of this assignment is to use the knowledge you have gained in CS370 to write a library to create and use semaphores using shared memory.

Points - Library (100), Test Program (100)


Description of Task

For this assignment, you will write a C library that implements a semaphore system that you can use to solve the reader/writer problem.

Your library will contain the following calls:

Specifications

  1. Your makefile shall create an C library file (.a) called libusem.a when make lib is called. If you don't know how to build a static C library, Google it. An example of a Makefile that does so can be found here.
  2. The library solution should contain 2 files, usersem.c and usersem.h.
  3. The file usersem.c will contain the source code to implement the routines.
  4. The file usersem.h will contain the constants, pointer to the global semaphore table, and prototypes necessary to compile and use the routines in usersem.c.
  5. Implementation of the semaphores will be done using shared memory and pthread mutexes and condition variables.

Testing

You will test your program by writing the reader/writer problem given in Midterm 1 using the semaphores from your library. This time, implement writer's preference rather than reader's preference.


What to Submit

Submit your tar file containing your .c and .h files for both the library and the test program, your Makefile, and a README file containing a description of each file and any information you feel the grader needs to grade your program.

The program files should be well documented with both data dictionaries and logic flow descriptions.

Your makefile should perform a make clean, make target, and a make all as well as the actions described above. Name the executables per the requirements.

You are required to work alone on this lab.

Submit all files using the RamCT CS370 Assignment Submission icon

This is Programming Assignment 3.


Late Policy

Please see here for the Late Policy regarding this assignment.



Copyright © 2001-2014: Colorado State University for CS370. All rights reserved.