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.

Is DMAI Buffer Code Threadsafe?



Is the Buffer code which is a part of DMAI thread safe?

I only ask because it's not acting like it.  But I haven't confirmed that.

Thx

  • Tom Hanson said:
    Is the Buffer code which is a part of DMAI thread safe?

    It seems that DMAI is not inherently thread safe, what sort of scenario are you running into trouble with?

  • Currently segmentation faults with a timing dependent behavior.  The classic: adding and removing print statements will make the fault disappear and reappear.

    There also appears to be an issue with variables (probably statics and globals but I haven't verified this) not being initialized on the second invocation of an executable.  Symptom: run the app, it works.  Run it again, it seg faults. If you do a "touch" on the executable in between, it runs.  This suggests that the executable is being cached in memory and not properly re-initialized.

     

    So, if DMAI is not thread safe, why is it used to build the multi-threaded applications that TI releases?

  • The symptom of print statements invoking faults does not necessarily indicate an issue with the thread-safe behaviour of DMAI - you haven't provided enough experimental data, but it could be any number of other things as well.

    The seg-fault non-cached instances of the app might also yet again be an issue with other aspects of the program

    Basically...there is in-sufficient experimental data in your post to lead to any conclusion about the behaviour of DMAI. Please use GDB to narrow down the segfault location and then post that here to assist the analysis.

    Jerry

  • JerryJohns said:
    Basically...there is in-sufficient experimental data in your post to lead to any conclusion about the behaviour of DMAI

    I agree, but then again, I wasn't looking for support in reaching a conclusion, merely answering Bernie's question.  I've been playing with the code for several months and a pattern of behaviour appeared which caused me to ask the question. Now that I have the answer, I can deal with it as appropriate.

    FYI: the seg fault location is within a "process" call to the AAC encoder when it is using a buffer at the end of a virtual page/segment.