---
# System prepended metadata

title: SEII Assignment 4
tags: [SEII]

---

---
tags: SEII
---

Maike Rieger, Andreas Roither, Markus Seiberl, Clemens Tögel

# SEII Assignment 4

In the picture above you can see our threads. Thread 1 is the main thread which is constantly running. Thread 2 - 4 are our own threads. As we can see Thread 2 (AirbagThread) is executed most.

![](https://i.imgur.com/zvNdGuS.png)
    
### Application Profiler (WCET)
Calculated Deep time / invocation counter.

| Method               | WCET(ms) | Period(ms) | Priority |
|----------------------|----------|------------|----------|
| Airbag Detection     | 0.00736  | 1          | highest  |
| Diagnostic Interface | 2.945    | 100        | medium   |
| CRC16                | 9.053    | 500        | lowest   |


## Simulation in Cheddar

The picture above shows the priorities which are selected according to RM. 

![](https://i.imgur.com/OnWl7gE.png)

The timeline returned as a simulation result with the task setup shows the three tasks and their execution times. The periods and capacities are set according to the results returned from the profiling analysis from step 1 (in order to simulate it correctly, only the relation between those times has to be correct). 

![](https://i.imgur.com/pgkecK0.png)

According to the simulation done using Cheddar no deadlocks or priority inversions could be identified. Also the fact that the priorities were not assigned according to RM did not have an effect on the simulation results. According to Cheddar the tasks are feasible schedulable (no deadlines are going to be missed).

## Additional possibilities to protect shared resources
In order to protect shared resources within an application, there exist two additional possibilities: 
> Mutexes and Semaphores.

Semaphores or mutexes could be implemented as soon as shared resources become an issue within the system. In this case mutexes might be the right choice since semaphores might only work out for one of the tasks but not for all of them.