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.

TDA4VM: Calling vxProcessGraph() from a Thread Created in a Node

Part Number: TDA4VM

Hi,

I have a graph called MainGraph, and one of its nodes (let's call it CallingNode) is on A72.

I also created a lib called SubGraph with its own vx_context/vx_graph, which has three functions:
Lib_Create()  - creates OpenVX context, graph, verifies graph,
Lib_Run() - calling vxProcessGraph(),
Lib_Destroy() - freeing resources.


In Process() function of CallingNode I am calling Lib_Run() to run the SubGraph,
but the call never returns, ie. it is stuck inside vxProcessGraph() function.
I found in this thread that you are saying that this is not possible, so I created a thread function like this

static void* ProcessThread(void* arg)
{
    while (1)
    {

        sem_wait(&g_inputReady);

        vxProcessGraph(g_graph);

        sem_post(&g_outputReady);

    }
    return NULL;
}

and Lib_Run() like this:

LibMsc_Run()
{
    sem_post(&g_inputReady);

    sem_wait(&g_outputReady);
}


So, I post the semaphore g_inputReady from Lib_Run(), to notify the thread that it can run the graph, and waiting on g_outputReady in Lib_Run(), but still vxProcessGraph() is stuck.
Seems like there is a problem with tivxEvents when the OpenVX function calls are done like this.

Why is this happening, and is there any solution for it?

Please note that lib works OK if I'm calling its functions from a standalone application, ie. not from a graph/node, but I need to be able to run it from the node.