|
18 | 18 | * threads for the system's highest and the thread entry function does not let out the CPU control, run the |
19 | 19 | * specified number of times after the creation of thread 0 in thread 0, a low-priority bound to the core 0, |
20 | 20 | * 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. |
21 | 44 | */ |
22 | 45 |
|
23 | 46 | /* Number of thread runs */ |
|
0 commit comments