Simple programs and Makefile for classroom demonstrations
- Sample Makefile
- hello.c: Your basic hello world in C
- infinite.c: For demonstrating cpu usage
- infinite2.c: Also for demonstrating cpu usage
Process and fork examples
- forkexample.c: Use of fork system call
- skeleton.c: Skeletal Shell for simple command (incomplete)
- mysignal.c: Simple use of signal system call
Sockets library examples
- client.c: Example TCP client
- server.c: Example TCP server that goes with the above client. This one is iterative.
- concurrentserver.c: Example concurrent TCP server that goes with the above client. Uses threads.
Simple pthread library examples
- chap5.c: First thread example, from Chapter 5 in Silberschatz et. al.
- another.c: Another thread example to show that pthreads in Linux can use both processors.
- yetanother.c: Yet another thread example to show that pthreads in Linux can use both processors.
Pthread library examples with shared resources
- raceexample.c: Pthread code with a race condition!!
- mutexex.c: Pthread code using mutex for mutual exclusion.
- semaphoreexample.c: Pthread code using semaphores to create a barrier synchronization for two processes.
- conditionexample.c: Pthread code demonstrating a simple condition wait.
- bounded.c: Pthread code for a solution to the Bounded buffer problem. Uses mutex and condition variables.
- concurrentserver.c: Example concurrent TCP server that goes with the client in the sockets section above. Uses the pthread library.
Java monitor examples from the text by Hartley on
Concurrent Programming in Java.
See http://csce.uark.edu/~aapon/courses/concurrent/ConcProgJava/
for more information on how to use these.
- Bounded buffer solution using
Java monitors. For one producer and one consumer.
- Bounded buffer driver
- Bounded buffer solution using
Java monitors. For multiple producers consumers.
- Driver
for multiple producer/consumer solution.
Sample code for Virtual Memory Experiment
- allocate.c