Learning goals

After following this tutorial, you will be able to:

  • Understand what ‘blocking’ allows you to do in Dezyne

  • Simplify an ‘external’ implementation with usage of ‘blocking’

  • Identify when ‘blocking’ may be used and when it may not be used

  • Reason about design decisions when using the ‘blocking’ keyword

Intended audience and prerequisites

During this tutorial, we will reconsider an implementation that handles possibly delayed communication over an ‘external’ port from the previous tutorial. It is extremely helpful, but not required to have followed that tutorial before starting this one.

The behaviour described with the ‘blocking’ keyword requires you to be able to reason about your application in terms of active threads and their calling context. In the tutorial, various examples will be discussed but it helps if you are familiar with the concepts.

Usage of ‘blocking’ requires the System it is contained in to be generated with a thread-safe-shell. For more information on the thread-safe-shell, please refer to this article and this article.

Platform choice

The platform choice from previous tutorials remains unchanged. Raspbian with g++ 4.9.2 on the Raspberry Pi supports all language requirements for using a thread-safe-shell and ‘blocking’ in C++11.