Examples for using Pthreads
The following codes can run on UCSB PC Solaris (Need to check if it workds on Linux).
Makefile
.
p_hello.c
. A hello program.
p_greetings.c
. Greeting code: One thread collects messages from others.
p_cpi.c
. Pi code.
p_matrix_para.c
. A simple matrix-matrix multiplication code.
Man pages for the pthread functions used in the above examples.
pthread_create
,
pthread_join
,
pthread_mutex
.
Additional information/tutorials on Pthreads
Pthreds tutorial at LLNL.
Programming POSIX Threads
.