Concurrency Examples
- a.sh b.sh
- c.sh d.sh
- semab.c sema.c semb.c These are three programs you can compile and run.
semab initializes a semaphore, sema does a release
operation on the semaphore and semb does an aquire on the
semaphore. After you have run semab, try running sema and semb in
different orders to see what happens. Please note that this is not a set
of programs, but it does allow you to see what happens when operations are
done in different orders.
- trade.c This program you can just compile and
run. It forks a process and then both processes update a global
counter. (Updated Nov 6.)
Shared memory examples
We are not covering shared memory in class this year.
- initshmem.c, readshmem.c
These are two separate programs. initshmem.c initializes a
shared memory segment and writes some data to it. readshmem.c
attaches to the same shared memory segment and reads the data from
the shared memory segment. You will need to change the file name
used in ftok.
- fsm.c
Last modified: Sun Mar 3 15:16:44 EST 2002