Oracle® Solaris Studio 12.4: Thread Analyzer User's Guide

Exit Print View

Updated: December 2014

Getting the Deadlock Tutorial Source Files

You can download the source files used in this tutorial from the Download area of the Oracle Solaris Studio developer portal.

After you download and unpack the sample files, you can find the samples in the SolarisStudioSampleApplications/ThreadAnalyzer directory. The samples are located in the din_philo subdirectory. The din_philo directory includes a Makefile and a DEMO file of instructions, but this tutorial does not follow those instructions or use the Makefile. Instead, you are instructed to execute commands individually.

To follow the tutorial, you can copy the din_philo.c file from the SolarisStudioSampleApplications/ThreadAnalyzer/din_philo directory to a different directory, or you can create your own file and copy the code from the following code listing.

The din_philo.c sample program which simulates the dining-philosophers problem is a C program that uses POSIX threads. The program can exhibit both potential and actual deadlocks.