• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/11-Mar-2024-13479

CMakeLists.txtD11-Mar-2024198 95

README.rstD11-Mar-20241 KiB4735

prj.confD11-Mar-202498 53

sample.yamlD11-Mar-2024358 1413

README.rst

1.. _synchronization_sample:
2
3Synchronization Sample
4######################
5
6Overview
7********
8
9A simple application that demonstrates basic sanity of the kernel.
10Two threads (A and B) take turns printing a greeting message to the console,
11and use sleep requests and semaphores to control the rate at which messages
12are generated. This demonstrates that kernel scheduling, communication,
13and timing are operating correctly.
14
15Building and Running
16********************
17
18This project outputs to the console.  It can be built and executed
19on QEMU as follows:
20
21.. zephyr-app-commands::
22   :zephyr-app: samples/synchronization
23   :host-os: unix
24   :board: qemu_x86
25   :goals: run
26   :compact:
27
28Sample Output
29=============
30
31.. code-block:: console
32
33   threadA: Hello World!
34   threadB: Hello World!
35   threadA: Hello World!
36   threadB: Hello World!
37   threadA: Hello World!
38   threadB: Hello World!
39   threadA: Hello World!
40   threadB: Hello World!
41   threadA: Hello World!
42   threadB: Hello World!
43
44   <repeats endlessly>
45
46Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
47