xref: /aosp_15_r20/test/dittosuite/example/priority_inversion_normal.ditto (revision 6fa2df46f119dce7527f5beb2814eca0e6f886ac)
1main: {
2  multithreading: {
3    threads: [
4      {
5        name: "High"
6        instruction: {
7          instruction_set: {
8            instructions: [
9              {
10                lock: {
11                  mutex { name: "lock1" }
12                }
13              },
14              {
15                cpu_work: {
16                  duration_us: 2000
17                }
18              },
19              {
20                unlock: {
21                  mutex { name: "lock1" }
22                }
23              }
24            ]
25          }
26          repeat: 100
27          period_us: 50000
28          offset_us: 1000
29        }
30        sched_affinity: 1
31        sched_attr: {
32          other: {
33            policy: OTHER
34            nice: -20
35          }
36        }
37      },
38      {
39        name: "Mid"
40        instruction: {
41          instruction_set: {
42            instructions: [
43              {
44                cpu_work: {
45                  duration_us: 10000
46                }
47              }
48            ]
49          }
50          repeat: 100
51          period_us: 30000
52          offset_us: 1500
53        }
54        sched_affinity: 1
55        sched_attr: {
56          other: {
57            policy: OTHER
58            nice: 0
59          }
60        }
61      },
62      {
63        name: "Low"
64        instruction: {
65          instruction_set: {
66            instructions: [
67              {
68                lock: {
69                  mutex { name: "lock1" }
70                }
71              },
72              {
73                cpu_work: {
74                  duration_us: 5000
75                }
76              },
77              {
78                unlock: {
79                  mutex { name: "lock1" }
80                }
81              }
82            ]
83          }
84          repeat: 100
85          period_us: 20000
86          offset_us: 0
87        }
88        sched_affinity: 1
89        sched_attr: {
90          other: {
91            policy: OTHER
92            nice: 19
93          }
94        }
95      }
96    ]
97  }
98}
99global: {
100  mutex { name: "lock1" }
101}
102