CSL373: Assignment 1 on Process control and IPC
Background reading
- Read chapter 2 of Unix Network Programming Volume 2: Interprocess Communications by W. Richard
Stevens
- Carefully read the following man pages: signal, ualarm, umask, sigprocmask,
gettimeofday, wait, exec, fork, pipe,open, ipc, clone, msgctcl, msgsnd,
msgrcf,rand, srand48.
- (optional) Read from the OS books the sections (bed time stories) that deal
with: CPU scheduling, processes, threads, IPC.
Processes
- Expand the hare and turtle process descriptions and implement IPC solutions by
defining cooperating processes.
- 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
- Now, develop the same application (hare and turtle) using Linux
pthreads (shared memory).
Tests
-
The current outcome of the race should be displayed after fixed intervals.
-
Try varying the speed and the sleeping time of the hare to see different
outcomes.
Note:
- To be done individually.
- The last date of submission of solutions using pipes, FIFOs and
message Qs (processes) is Jan 16 (strict).
The last date for the threads assignment is Jan 23.