AnsweredAssumed Answered

Question about Multiprocessor Messaging with VDK

Question asked by Mason on Nov 25, 2010
Latest reply on Nov 26, 2010 by BrianW

Hello everyone,

        I want to test the multiprocessor messaging function with VDK. My platform is TS-201 EZ-KIT Evaluation Board. By running the examples named "Producer_Consumer" located in directory "Analog Devices\VisualDSP 5.0\TS\Examples\ADSP-TS201 EZ-KIT Lite\VDK", I found everything was OK.But I am interested in Multiprocesssor Messaging with payload of strings or characters. So I made some modifications to the example code. The details are as follows.

Modification 1:

     The modification of the function "static void consume_item(void * item)" is as follows:

static void consume_item (void *item)
{
//int i = reinterpret_cast<int>(item);
char* i=reinterpret_cast<char*>(item);
//printf("Consumer ID %d Received %d from the random-number producer\n",
//    VDK::GetThreadID(), i);
    puts(i);
VDK::Yield();
}

 

Modification 2:

     The modication of the function "static void produce_item(void **ppItem)" is as follows:

static void produce_item(void **ppItem)
{
//int val = rand();
char* val="He";
//*ppItem = reinterpret_cast<void*>(val);
*ppItem=reinterpret_cast<char*> (val);
}

 

      Finally, I didn't get the expected string "He", but  some messy words instead, in the output window after running the compiled and linked project.
      Thanks for your help in advance!

                                                                                                                                                                            John Manson

Outcomes