ThreadX SMP only running one thread at a time

Collin 0 Reputation points
2023-02-08T21:06:38.53+00:00

As the title states, I am running the SMP version of ThreadX and despite having 4 cores to work with, I am only seeing one thread running at a given time. I am a little uncertain if this is the expected behavior or not. I found this line in the documentation:

At any given moment, only one thread is in an executing state. This is because a thread in the executing state has control of the underlying processor.

which would indicate that it is expected behavior, but that line is copy-paste from the documentation for the non-SMP version so I'm not sure if it is accurate or not. In my mind, only having a single thread running at a time would defeat the purpose of SMP so I'm wondering if this is intended and there is some technical reason why only one thread can run, or if there is perhaps something wrong with my ThreadX setup.

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cindy Deng 6 Reputation points
    2023-02-09T16:57:13.6+00:00

    Hi @Collin,

    ThreadX SMP should enable multiple threads running across multiple cores at the same time. With your 4 core system, you can expect 4 threads to be in the executing state simultaneously, one thread on each core. I would recommend you double check any configuration files such as tx_user.h and tx_port.h in your project, specifically any options related to cores with SMP enabled. Do you mind sharing which SMP port are you using?

    Thanks,

    Cindy


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.