Embedded Control Systems Design/Asynchronous activities

< Embedded Control Systems Design

This chapter explains how to exchange data between two activities that run in parallel, or to synchronize their executions.

interrupts and ISRs

Interrupts and ISRs (interrupt service routines) are the lowest level of asynchronous activity. All higher levels are built on this foundation. In some cases, the RTOS will handle all the low-level details for you.

We discuss interrupt and ISRs in more detail in other chapters --

threads sharing memory

Exchanging data between two threads sharing memory ...

medium level

interprocess communication

high level (= Interprocess Communication via asynchronous message passing between processes in separate protected memory areas).

computer to computer communication

RPC (remote procedure calls) ...

Software problems

When implementing the software code in a robot, there can be problems with synchronous threads. This section gives some bad programming examples in multithreaded systems. It is illustrated in C-code. They are concerned because it is a first step to understand problems which occur do to concurrent engineering on a higher level.





If the first thread decrements the counter and is then preempted, the second thread also decrements the counter and evaluates it afterwards. Both threads can't continue since the counter is at -1 now. There is a deadlock situation in the executed program.

This problem can also arise at a higher level of abstraction. The deadlock situation in petri nets will be described in the following section.

further reading

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.