I had previously asked a related question to the topic found here. From that, I was able to get a working port of ThreadX SMP for the hardware I am using. Using that port, I then proceeded to run the test that gave me issues initially and I am seeing the same unexpected behavior. The situation is as follows:
- Have 1 thread with a preemption threshold set higher than its priority and no time slice.
- Have some number of other threads (I'm using 5) set to a lower priority than the first thread with no preemption threshold and no time slice.
- Have all threads use the same entry point which contains no blocking function calls.
When I run this, I expect to see output from every thread as there are 4 cores to work with so while the high priority thread is executing on one core, the lower priority threads still have open hardware they can run on. Instead, I am only seeing the higher priority thread running as if it was blocking the other threads. Curiously, if I disable the preemption threshold on the higher priority thread, every thread runs as expected.
My question is, why does having a preemption threshold block lower priority threads from running, even when there is open hardware to run on? Is this behavior expected, or is there some sort of bug in the program? I have attached the main file I used to demonstrate this behavior (had to change the extension from .c to .txt to allow it to be uploaded). That file is the only one that I modified with the rest of the port staying the same as what I received.
sample_threadx.txt