zephyr/samples/legacy/philosophers/microkernel
Anas Nashif 2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
..
src kernel: add k_cpu_idle/k_cpu_atomic_idle() 2016-12-15 16:17:38 -05:00
Makefile samples: tests: remove obsolete KERNEL_TYPE and kernel variables 2016-11-04 15:47:25 -04:00
README.txt build: abstract emulation and replace qemu goal with run 2017-01-10 20:20:47 +00:00
prj.conf kernel: add LEGACY_KERNEL option 2017-01-09 19:42:13 +00:00
prj.mdef
sample.tc
testcase.ini samples: tests: tag all legacy test cases and samples 2016-11-30 21:45:22 +00: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 run

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

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.