Introduction
There are many models for accessing memory: PRAM, Actor Model, Petri Nets, Tuple Spaces, Scoop, Process calculi, etc.
Since we are using the PRAM (= Parallel Random Access Machine) model, this will be further discussed:
- Processes can only communicate with each other by accessing shared Memory
- MAU connects the Processes with Shared Memory
Moreover, it needs to be defined if reading/ writing should be Exclusive or Concurrent. Therefore, at least four ways of implementation are possible.
- Exclusive Read Exclusive Write (EREW) → only one Process can read/ write at the same time
- Exclusive Read Concurrent Write (ERCW) → only one Process read at the same time, but many Processes can write at the same time
- Concurrent Read Exclusive Write (CREW) → only one Process write at the same time, but many Processes can read at the same time
- Concurrent Read Concurrent Write (CRCW) → many Processes can read/ write at the same time
The netx90 uses shared Memory. Both ARM Cortex-M4 Processors can read/ write to Memory simultaneous. Therefore, the netx90 has a CRCW implementation.
Heap/ Stack
The program’s machine instructions (e.g. executable code) are stored in the text area. Global and static data are stored in initialized/ uninitialized data. The “malloc” operator allocates memory on the heap and can be released with the “free” operator. Therefore, memory allocated on the heap is always where space is left on the heap. Memory holes are the consequence. The stack contains all the automatic, non-static variables and is implemented as “least in first out” structure. The operator “push” allocates memory on the stack, “pop” releases the last allocated element from the stack.
Stack-overflow
If the stack is full and a push operation is executed, the stack is considered to be in an overflow state and may override data on the heap.
Remarks on using FreeRTOS
static vs dynmic memory allocation
- netx drv mutex, tasks, semaphores, etc