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.

Issues about process exit

Hi,

I met some issues when the program exits. The following is the thread map of my program. The recv thread1 receive video streams and generate video frames. The send thread1 feed the video frames to decoder. The recv thread2 get the decoder output. The mosaic thread dup the decoder output, do picture mosaic and feed the raw data to encoder. The send thread2 get the encoder output and send the video streams.

As in the picture above, I use ipcFramesInHLOSLink and ipcFrameOutHLOSLink to exchange data between ARM and videoM3. When the program exits, there will be errors as following and the program will down. 

[host] IPC_FRAMESINLINK:!WARNING!.Commands not being processed by link.TimeSinceLastAlloc:24345,TimeSinceLastFree:24345

[host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:19150,TimeSinceLastGetFree:19150

 

I go through the ipcFrameLink codes and find that it is because the ipcFrameInHLOSLink and ipcFrameOutHLOSLink will periodically generate SYSTEM_CMD_NEW_DATA or SYSTEM_IPC_CMD_RELEASE_FRAMES commands and wait for the neighbor Link to output NewData(DecLink) or  output notify (ipcFrameInRTOSLink). If the commands could not be handled in time and the number of pending commands exceeds the max number(8), the above errors will occur. So, I think I must stop the ipcFrameInHLOSLink and ipcFrameOutHLOSLink before I delete all the threads.

I try to stop all the links first and then delete the threads as the following order, but the errors are always appear.

mosaic thread -> recv thread2 -> send thread2->send thread1->recv thread1

 

So, could someone know the reasonable order of delete the threads?

Thanks in advance!

  • Hi,

    I try to adjust the delete order of the threads and the links, but still could not manage to exit the program successfully.

    When the program is not so complicated, such as fileread->encode->send, it could exit with no problem. Could someone help me to solve the problem?

    Thanks so much! Appreciate for your reply!