CSP301: Assignment 1 on Inter-Process Communication

Background reading

  1. Read chapter 2 of Unix Network Programming Volume 2: Interprocess Communications by W. Richard Stevens
  2. Carefully read the following man pages: signal, ualarm, umask, sigprocmask, gettimeofday, wait, exec, fork, pipe,open, ipc, clone, msgctcl, msgsnd, msgrcf,rand, srand48.

Processes

  1. Expand the hare and turtle process descriptions and implement IPC solutions by defining cooperating processes.
  2. First use fork() and execve() to create the processes and develop complete applications using the following Linux IPC (message passing) mechanisms separately: (i) pipes (ii) FIFO files and (iii) message queues.

Threads

  1. Now, develop the same application (hare and turtle) using Linux pthreads (shared memory).

Tests

Note:

  1. To be done individually.
  2. On program exit, all process state should be cleaned up properly
  3. The logic should be implemented correctly. For example, the hare should check again after waking up whether it should go back to sleep or run
  4. The last date of submission of solutions using pipes, FIFOs and message Qs (processes) is Aug 14. The last date for the threads assignment is Aug 21.