zephyr/samples/philosophers/microkernel
Yannis Damigos 31100d1a61 samples:philosophers:Reformated 80-column width, 80-chars tabs
This patch reformats philosophers sample to fit in 80 columns
with 8-char tabs. It also fixes other coding style issues
reported by chechpatch.pl script with -f option.

Change-Id: Ie7ed59db4e67e279a26000247a1838221ac37cd3
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-08 13:54:53 +00:00
..
src samples:philosophers:Reformated 80-column width, 80-chars tabs 2016-03-08 13:54:53 +00:00
Makefile move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00
README.txt move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00
prj.mdef move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00
prj_arm.conf move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00
prj_x86.conf move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00
testcase.ini move sample apps to top level directory under samples/ 2016-02-11 13:08:44 -05:00

README.txt

Title: Dining Philosophers

Description:

An implementation of a solution to the Dining Philosophers problem
(a classic multi-thread synchronization problem).  This particular
implementation demonstrates the usage of microkernel task groups,
Mutex APIs and timer drivers from multiple (6) tasks.

The philosopher always tries to get the lowest fork first (f1 then f2).
When done, he will give back the forks in the reverse order (f2 then f1).
If he gets two forks, he is EATING.  Otherwise, he is THINKING.

Each philosopher will randomly alternate between the EATING and THINKING
states.

--------------------------------------------------------------------------------

Building and Running Project:

This microkernel project outputs to the console.  It can be built and executed
on QEMU as follows:

    make qemu

--------------------------------------------------------------------------------

Troubleshooting:

Problems caused by out-dated project information can be addressed by
issuing one of the following commands then rebuilding the project:

    make clean          # discard results of previous builds
                        # but keep existing configuration info
or
    make pristine       # discard results of previous builds
                        # and restore pre-defined configuration info

--------------------------------------------------------------------------------

Sample Output:

Philosopher 0 EATING
Philosopher 1 THINKING
Philosopher 2 THINKING
Philosopher 3 EATING
Philosopher 4 THINKING
Philosopher 5 THINKING








Demo Description
----------------
An implementation of a solution to the Dining Philosophers problem
(a classic multi-thread synchronization problem).  This particular
implementation demonstrates the usage of multiple (6) tasks
of differing priorities and the nanokernel semaphores and timers.