Skip to content

Commit cafd9c6

Browse files
Tm-C-mTRbb666
authored andcommitted
[docs][utest]:Add comments for smp_affinity_pri2
Add comments for smp_affinity_pri2 Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
1 parent ea37d4c commit cafd9c6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/utest/smp/smp_affinity_pri2_tc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@
1818
* threads for the system's highest and the thread entry function does not let out the CPU control, run the
1919
* specified number of times after the creation of thread 0 in thread 0, a low-priority bound to the core 0,
2020
* the thread will not preempt the core 0 is running on threads
21+
*
22+
* Test Case Name: [smp_affinity_pri2]
23+
*
24+
* Test Objectives:
25+
* - Verify that threads with low-priority unbound cores do not preempt high-priority threads.
26+
*
27+
* Test Scenarios:
28+
* - RT_CPUS_NR threads (T0~T(RT_CPUS_NR-1)) are created, with each thread bound to its respective core. Among them,
29+
* - the thread on core 0 has a medium priority (THIGH_PRIORITY), while the other threads have the highest priority (THREAD_PRIORITY).
30+
* - All threads share a common entry function thread_entry. In thread_entry, only the threads running on non-core-0 cores
31+
* - execute an infinite loop (i.e., they do not release core ownership). After running for a certain period of time,
32+
* - the thread on core 0 checks whether run_flag equals 0 after creating a low-priority (LOW_PRIORITY) thread Tn. The entry
33+
* - function of Tn is thread_temp_entry, and Tn will be destroyed after setting run_flag = 1.
34+
*
35+
* Verification Metrics:
36+
* - Output message: [I/utest] [ PASSED ] [ result ] testcase (core.smp_affinity_pri2)
37+
*
38+
* Dependencies:
39+
* - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256.
40+
*
41+
* Expected Results:
42+
* - After T0 creates Tn, no scheduling occurs. T0 immediately checks whether run_flag is not equal to 1, and if this condition
43+
* - is true, it indicates that Tn has failed to preempt T0.
2144
*/
2245

2346
/* Number of thread runs */

0 commit comments

Comments
 (0)