This repository contains several implementations of solutions for "Dining Philosophers" problem. These solutions are built by using Actor and CSP models on top of SObjectizer framework.
Since Jan 2020 a compiler with support of C++17 is required. A C++14 version can be found under the tag 20190129.
This repository contains only source codes of the examples. SObjectizer's source code is not included into the repository. There are two ways to get the examples and all necessary dependencies.
Since Nov 2025 the project uses vcpkg for dependency management.
You need CMake to compile and build the examples.
# Step 1: obtaining vcpkg.
git clone --depth=1 https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ..
# Step 2: obtaining the project.
git clone --depth=1 https://github.com/Stiffstream/so5-dining-philosophers
cd so5-dining-philosophers
# Step 3: building the project.
mkdir cmake_build
cd cmake_build
cmake -DCMAKE_INSTALL_PREFIX=target \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
cd binThe results will be in bin subfolder.
Obtaining the project:
# Obtaining the project.
git clone --depth=1 https://github.com/Stiffstream/so5-dining-philosophers
cd so5-dining-philosophersThen, if you have VCPKG_HOME environment variable (there is no need to specify CMAKE_TOOLCHAIN_FILE):
mkdir cmake_build
cd cmake_build
cmake -DCMAKE_INSTALL_PREFIX=target \
-DCMAKE_BUILD_TYPE=release ..
cmake --build . --config Release
cd binBut if VCPKG_HOME is not specified, then:
mkdir cmake_build
cd cmake_build
cmake -DCMAKE_INSTALL_PREFIX=target \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_TOOLCHAIN_FILE=VCPKG_LOCATION/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
cd binwhere VCPKG_LOCATION is the path to vcpkg directory.