Back to Taskflow

Intel® Threading Building Blocks.Dining_philosophers sample

3rd-party/tbb/examples/graph/dining_philosophers/readme.html

4.0.01.5 KB
Original Source

Intel® Threading Building Blocks. Dining_philosophers sample

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.

System Requirements

For the most up to date system requirements, see the release notes.

Files

dining_philosophers.cppSource code for the example. MakefileMakefile for building the example.

Directories

msvsContains Microsoft* Visual Studio* workspace for building and running the example (Windows* systems only). xcodeContains Xcode* IDE workspace for building and running the example (macOS* systems only).

For information about the minimum supported version of IDE, see release notes.

Build instructions

General build directions can be found here.

Up to parent directory


Legal Information

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2020, Intel Corporation