zephyr/samples/synchronization
Anas Nashif 0ad13320cd doc: application porting guide to the unified kernel
Change-Id: I463b50336f6438ed5dc4ae60bf0d3f7b6e1118a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 18:13:03 -05:00
..
src samples: Add the ARG_UNUSED macro 2016-12-21 12:54:53 +00:00
Makefile tests: introduce Makefile.test 2017-01-03 17:48:44 +00:00
prj.conf samples: synchronization: move to legacy/ 2016-11-02 22:05:29 +00:00
README.rst doc: application porting guide to the unified kernel 2017-01-16 18:13:03 -05:00
sample.tc samples: synchronization: move to legacy/ 2016-11-02 22:05:29 +00:00
testcase.ini samples: tests: remove obsolete KERNEL_TYPE and kernel variables 2016-11-04 15:47:25 -04:00

.. _synchronization_sample:

Synchronization Sample
######################

Overview
========

A simple application that demonstates basic sanity of the kernel.
Two threads (A and B) take turns printing a greeting message to the console,
and use sleep requests and semaphores to control the rate at which messages
are generated. This demonstrates that kernel scheduling, communication,
and timing are operating correctly.

Building and Running
====================

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

.. code-block:: console

   $ cd samples/synchronization
   $ make run

Sample Output
-------------

.. code-block:: console

   threadA: Hello World!
   threadB: Hello World!
   threadA: Hello World!
   threadB: Hello World!
   threadA: Hello World!
   threadB: Hello World!
   threadA: Hello World!
   threadB: Hello World!
   threadA: Hello World!
   threadB: Hello World!

   <repeats endlessly>