### BTF Example (MultipleTaskActivationLimit 3)

To clarify the interpretation of the multipleTaskActivationLimit (MTA) property of tasks, we provide a simple BTF trace example. In this example we focus on one task with an MTA = 3. Here we will show the internal task instance states of each of the three task instances. MTA = 3 means that at any given time only three task instances of the same task shall be active. A fourth activation will just be ignored. So at any given time, according to the BTF process state machine, only three state machines will exist to represent the state of their corresponding task instance.

Consider the following BTF trace:

    #version 2.2.1
    #timeScale ns
    0,ECU_1,-1,SIM,SIM,-1,tag,ECU_INIT
    0,Processor_1,-1,SIM,SIM,-1,tag,PROCESSOR_INIT
    0,Core_1,-1,SIM,SIM,-1,tag,CORE_INIT
    0,Core_1,0,C,Core_1,0,set_frequence,10000000
    0,Stimulus_Task,0,STI,Stimulus_Task,0,trigger
    0,Stimulus_Task,0,T,Task,0,activate
    100,Core_1,0,T,Task,0,start
    100,Task,0,R,Runnable_1,0,start
    19800,Task,0,R,Runnable_1,0,terminate
    19800,Task,0,R,Runnable_2,0,start
    20000,Stimulus_Task,1,STI,Stimulus_Task,1,trigger
    20000,Stimulus_Task,1,T,Task,1,activate
    40000,Stimulus_Task,2,STI,Stimulus_Task,2,trigger
    40000,Stimulus_Task,2,T,Task,2,activate
    42000,Task,0,R,Runnable_2,0,terminate
    42000,Core_1,0,T,Task,0,terminate
    42100,Core_1,0,T,Task,1,start
    42100,Task,1,R,Runnable_1,1,start

The corresponding states, at specific points in time are shown in the following. We therefore show the composed state of three state machines for Task, indexed with [1..3]. The light blue colored state is the current state the state machine is in. So at the beginning of the trace the three state machines look like this:

#### State after timestamp 0

After Task has been activated Task[1] is now in the state activated and the state machines look like this:

#### State after timestamp 100

Once the scheduler decided the task should run, Task starts and, correspondingly, changes its state:

#### State after timestamp 20000

Here, a second instance of Task is activated while the first has not yet terminated. So Task[2] enters the activated state:

#### State after timestamp 40000

Again, another instance of Task is activated so Task[3] enters the activated state:

#### State after timestamp 42000

Task[1] has terminated (displayed in grey):

#### State after timestamp 42100

Now, there is room for the state machine for the next task instance, we called it Task[4]. Also, the scheduler decided to let Task[2] run: