Overview

The Dining Philosophers problem demonstrates tbb::flow and the use of the reserving join node to solve the potential deadlock.
This program runs some number of philosophers in parallel, each thinking and then waiting for chopsticks to be available before eating. Eating and thinking are implemented with sleep(). The chopstick positions are represented by a queue_node with one item.

Source Files

dining_philosophers.cpp
Source code for the example.
Makefile, Makefile.windows
Makefiles for building example.

Directories

src
Contains source file mentioned above.
msvs
Contains Microsoft* Visual Studio* 2005 workspace for building and running the example (Windows* systems only).
xcode
Contains Xcode* IDE workspace for building and running the example (OS X* systems only).

To Build

General build directions can be found here.


Up to parent directory

Copyright © 2005-2014 Intel Corporation. All Rights Reserved.

Intel is a registered trademark or trademark of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.