Explore chapters and articles related to this topic
Inter-Task Synchronization and Communication (IPC) Based on Shared Memory
Published in Gedare Bloom, Joel Sherrill, Tingting Hu, Ivan Cibrario Bertolotti, Real-Time Systems Development with RTEMS and Multicore Processors, 2020
Gedare Bloom, Joel Sherrill, Tingting Hu, Ivan Cibrario Bertolotti
In simple cases, mutual exclusion can be ensured by resorting to special machine instructions that implement the lock-based protocol just discussed. For example, on the Intel 64 and IA-32 architecture [67], the instruction increments a memory-resident integer variable by one. When executed, the instruction loads the operand from memory, increments it internally to the processor, and finally stores back the result. It is therefore subject to the same race condition depicted in Figure 7.2. However, when the instruction is preceded by the prefix, the processor executes the whole sequence atomically—that is, indivisibly—even in a multiprocessor or multicore system. More specifically, the processor does not accept interrupts while executing the instruction, and the cache coherency and memory bus access protocols ensure that the operation is carried out atomically also with respect to memory.
Real-Time Operating Systems
Published in Leanna Rierson, Developing Safety-Critical Software, 2017
Deadlock is a condition where no processes will be completed because they cannot access the resources they require to make progress. The following conditions must be true for a deadlock to occur: (1) mutual exclusion (resources may only be allocated to one process at a time), (2) hold and wait (a process may allocate a resource and wait for others), (3) no preemption (a resource may not be forcibly taken away), and (4) circular wait (processes are holding resources that other processes need). Deadlock is almost impossible to find by testing, but may be found by analysis (formal methods can help with this). Deadlock is typically avoided through design [7] by preventing one of the four conditions in the RTOS architecture [21].
Real-Time Scheduling Based on the Cyclic Executive
Published in Ivan Cibrario Bertolotti, Gabriele Manduchi, Real-Time Embedded Systems, 2017
Ivan Cibrario Bertolotti, Gabriele Manduchi
For example, a mutual exclusion semaphore can be used to ensure that only one process at a time is allowed to operate on shared data. Similarly, a message can be used to make one process wait for the result of a computation carried out by another process and pass the result along. Nevertheless, the program will still exhibit a significant amount of nondeterminism because its processes may interleave in different ways without violating any of those constraints. The concurrent program output will of course be the same in all cases, but its timings may still vary considerably from one execution to another.
A traffic monitoring stream-based real-time vehicular offence detection approach
Published in Journal of Intelligent Transportation Systems, 2018
A producer–consumer model is adopted in the parallel implementation. The producer puts an incoming record to the tail of a queue, called the resource queue, which links the incoming traffic records, while the consumer obtains a new record from the head. In the proposed method, a single producer thread and multiple consumer threads are launched and work simultaneously. The Resource queue is shared by the producer thread and multiple consumer threads. Whenever a consumer thread obtains a record, it independently performs offence detection. A mutual exclusion lock is added at the head of the resource queue to protect it from being modified by multiple threads simultaneously. Figure 3 shows how the vehicular records are organized.
Integrated fault-tolerant control of assembly and automated guided vehicle-based transportation layers
Published in International Journal of Computer Integrated Manufacturing, 2022
Pawel Majdzik, Marcin Witczak, Bogdan Lipiec, Zbigniew Banaszak
The mutual exclusion is a property of concurrency control in which only one task, from a set of concurrent tasks, can perform its critical section. The execution of the critical section refers to an interval of time during which a task accesses a shared resource. To explain the representation of the mutual exclusion framework, let us start with the synchronization of inlet conveyor belts realized by the Epson robot (points 1a, 1b and 2 in figure 1). The operation of picking a cube up from two input conveyor belts is to be considered as a critical section. This is due to the fact that at the same time the Epson robot can only operate one of the two cubes. Additionally, as long as the picking up operation is performed, the conveyor belt is stopped. This means that the subsequent cube can be transferred iff the previous one is taken away with the Epson manipulator. Such a relation is treated as a critical operation. This lead to the transformation of conveyor belt operation portrayed in figure 4. It can be observed that the transportation operation pertaining to the first belt can be started immediately after processing operation (with the start time denoted by ) is terminated. This feature is represented by the arcs (weighted by ) among and inlets and , respectively. Consequently, this part of the system can be perceived and analysed as a closed and cyclic one.