自己搭建一个IPC拓扑结构,使用messageQ的方式,具体结构为0核为主核,1-7核为从核,8个核均创建了message queue,现在0核分别打开1-7核的message queue,但是只能打开1核的queue,不知道为什么?求指导?谢谢,部分代码如下:
if (MultiProc_self() == 0)
{
/* Open the remote message queue. Spin until it is ready. */
do {
status = MessageQ_open(MultiProc_getName(1), &remoteQueueId01);
/*
* Sleep for 1 clock tick to avoid inundating remote processor
* with interrupts if open failed
*/
if (status < 0){ Task_sleep(1); } } while (status < 0);
/* Open the remote message queue. Spin until it is ready. */
do {
status = MessageQ_open(MultiProc_getName(2), &remoteQueueId01);
/*
* Sleep for 1 clock tick to avoid inundating remote processor
* with interrupts if open failed
*/
if (status < 0){ Task_sleep(1); } } while (status < 0);
/* Open the remote message queue. Spin until it is ready. */
}
xt guo:
if (MultiProc_self() == 1) { /* Open the remote message queue. Spin until it is ready. */ do { status = MessageQ_open(MultiProc_getName(0), &remoteQueueId02); /* * Sleep for 1 clock tick to avoid inundating remote processor * with interrupts if open failed */ if (status < 0){ Task_sleep(1); } } while (status < 0); /* Open the remote message queue. Spin until it is ready. */ do { status = MessageQ_open(MultiProc_getName(2), &remoteQueueId03); /* * Sleep for 1 clock tick to avoid inundating remote processor * with interrupts if open failed */ if (status < 0){ Task_sleep(1); } } while (status < 0); printf(" I LOVE JingJing \n"); } else { /* Open the remote message queue. Spin until it is ready. */ do { status = MessageQ_open(MultiProc_getName(1), &remoteQueueId); /* * Sleep for 1 clock tick to avoid inundating remote processor * with interrupts if open failed */ if (status < 0){ Task_sleep(1); } } while (status < 0); }
把1核当主核就可以了,但是为啥第一次运行不对,必须软件复位一次才正确。
xt guo:
qmssIpcBenchmark_c6678
shmIpcBenchmark_c6678
分别在以上两个例程中修改均不正确,最多只能打开3个核的队列,为什么??????????????????
xt guo:
??????????????????????????????????????????????????????????????
TI中文支持网