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.

What's the possible reason to cause the NameServer_getUInt32 being blocked( or deadlock)

Hi all,

   When  I run my application program on dual-core of C6678evm. the program 

 is blocked at function NameServer_getUInt32 . I create the entry in my cfg

files below:

var NameServer = xdc.useModule("ti.sdo.utils.NameServer");

 var params     = new NameServer.Params;

Program.global.barrierTable = NameServer.create("barriers", params);

Program.global.shmTable = NameServer.create("codecshm", params);

And then use it.

 

 I find that core0 can creat bar and the shared memory  section successfully.

Because valid value is returned after calling the next 2 functions in core0:

ipcBarrier = Bar_create("BARRIER0", nCoresInBarrier, (void *)barrierTable);

NameServer_addUInt32((NameServer_Handle)barrierTable, name, (UInt32)bar);

NameServer_addUInt32((NameServer_Handle)shmTable, "SHARE", (UInt32)share);

But the function below will be blocked when running on core1:

ipcBarrier = Bar_open("BARRIER0", (void *)barrierTable);

status = NameServer_getUInt32((NameServer_Handle)barrierTable, name, (UInt32 *)&bar, NULL);

status = NameServer_getUInt32((NameServer_Handle)shmTable, "SHARE", (UInt32 *)&share, NULL);

I am confused about the possible reason causing NameServer_getUInt32 be blocked and how to debug these

functions in CCS. They are library functions. So no source code provided to check the reason.

Thanks a lot!

 

B.R.

Sunzhao

  • Hi,

    First of all, you have to call Bar_open() and NameServer_getUInt32() from within a task thread (ie not from within main()) for these APIs to work properly.

    Second, you should loop on your Bar_open() call until a non-NULL value is returned before calling NameServer_getUInt32(). This is required due to the difference in the core climbup sequence timings.

    Alan

  • Hi Alan,

         Thank you for the reply.

         1. I have called the Bar_open() and NameServer_getUInt32()  from a task not main function.

         2. Sorry for the confusion, The NameServer_getUInt32() is one subfunction of Bar_open(), the function is paste below:

    Bar *Bar_open(String name, void* barrierTable)

     {    

      Int status;    

      Bar *bar;

        /* Try to open the remotely/locally created barrier */    

     status = NameServer_getUInt32((NameServer_Handle)barrierTable, name, (UInt32 *)&bar, NULL);    

    if (status < 0) {        

     /* Barrier not available yet */        

    return (NULL);    

    }     /* Return the barrier ptr  */    

    return (bar);

     }

          3. Is it possible to do debugging on Nameserver module?

    Thanks a lot!

    B.R.

    Sunzhao

  • Sunzhao,

    If you add the following to your config file, you should be able to do full symbolic debug of your application:

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.libType = BIOS.LibType_Debug;

    Be advised that linking with the debug libraries will result in your application being larger and slower.

    Alan