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.

C6678多核编程,设置同步标志时用了cache保护,仍然做不到每个核同步更新。



各位工程师好:

        我在L2共享内存中申请了一个同步标志multiCoreSyncDoneCore0Wait[0],每一个核运行到的时候标志的相应位就置一:

if(CoreNum){

       SYS_CACHE_INV ((void *) &multiCoreSyncDone[0], 128, CACHE_WAIT);

       multiCoreSyncDoneCore0Wait[0] |= (Uint8)(1<<CoreNum);

       SYS_CACHE_WB ((void *) &multiCoreSyncDoneCore0Wait[0], 128, CACHE_WAIT);

}

else{

       while(multiCoreSyncDoneCore0Wait[0] != 0xFF)

       SYS_CACHE_INV ((void *) &multiCoreSyncDoneCore0Wait[0], 1, CACHE_WAIT);

}

对于每个核multiCoreSyncDoneCore0Wait[0]的值都是不同的,请问这是因为核同步操作不能多个核同时操作一个数,即使是不同位也不可以么?

                                                                                                                                                                                                                                               谢谢!