This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Possibility of using multiple threads on alg-plugin.

Other Parts Discussed in Thread: SYSBIOS

Hello,

I am using Vision SDK 2.11 for TDA 3x. I want to know, if it is possible to create multiple threads on single alg-plugin on any core (DSP/EVE/IPU). If possible, what advantage it might give (i.e. if it would run in

parallel). It will really help me if you give me any method (except LMSD) to run two modules parallely on same core.

Regards,

Neel

  • Hi, Neel,

    The VSDK experts have been notified. They will respond here.

    Regards,
    Mariya
  • Hi Neel,

    In Vision SDK framework, each Link is generally running in an individual Task (Thread). However, on DSP/EVE, all algorithm links are running in single task (thread). The reason for this implementation is because we don't want to preempt in the middle of algorithm process call. If the algorithm process is preempted, it means the current algorithm will lose cache/scratch buffer and incur overhead to save/restore context.
    If the algorithms are running on different cores, it will most likely improve performance from running in parallel.

    In any case, Vision SDK is based on TI RTOS (SYSBIOS), you can create new Task (thread) in the algorithm plug-in if desired.
    Just use BspOsal_taskCreate() from BSP. You can find the API guide, BSP_ApiGuide.CHM, from the index.htm under vision_sdk/docs/ folder.

    Regards,
    Stanley
  • Hi Stanley,

    Thanks for your reply. I just want to confirm one thing, if I use BspOsal_taskCreate() to create two (or more) tasks on same plugin (on same core), will I be able to achieve some performance gain. The reason I am asking this is because I am having many optimized modules and I want to run these modules parallely. Like you said it is possible on different cores, but if I am having more modules (say 10), is it possible to run them parallely. If not, is there any way I can achieve some performance gain.

    Regards,
    Neel
  • Neel
    VSDK Alg link does not limit you to create multiple threads on single alg-plugin on any core (DSP/EVE/IPU). But that should be align/depends with your algorithm design.
    Ideally, if you want to run multiple algos on a single core, you can create multiple Alg links (multiple instances) for each Algorithm. All these links will run on a same core with priority based invocation. For example, DSP1 is a single core and it can run only one Algo at a time. So different alg links on the DSP1 will run one after another. But the Alg links on different cores, say DSP1 or EVE1 will run simultaneously

    regards, Shiju
  • Hi Shiju,
    Suppose I create 4 threads on single alg-plugin instead of creating 4 alg-plugins , will it give me some performance benefits.

    Regards,
    Neel
  • Neel
    Not really as only one task can run at a time, i mean each thread can only be run one after another.
    keeping multiple links provide you better flexibity to handling the data flow and even the links become simple.
    Acutally on DSP & EVE we have a special mechanism where only one tasks gets created even there are multiple Alg links, where we choose Utils_tskMultiMbxCreate instead Utils_tskCreate.

    regards, Shiju
  • Hi Shiju,
    Thanks for your reply.
    Regards,
    Neel