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.

请教6678中gate的用法

Other Parts Discussed in Thread: SYSBIOS

本人使用的是TI6678evm+ccsv5.2环境,在学习gate的相关用法。发现很多模块里面都提供了gate相关子模块,比如说sysbios里面的GateTask,GateMutex等,xdctools runtime里面的Gate,IPC模块里面的GateMP子模块,请问这些模块有共同点吗,其使用的基础是什么呢,作用一致吗?

请问Gate是用来做共享互斥访问的吗,有没有这样的例子程序。我编了一个sysbios下使用GateTask的例子,但是感觉共享变量并没有得到保护,加了gate之后,该变量还是被两个thread同时访问了。GateTask有一个Q_BLOCKING属性,不知道怎么把该属性置为有效,试了很多方法,语法上都编译不通过,这应该如何配置呢。

烦请不吝赐教,谢谢!

  • gate都是用来做资源互斥,不同的gate底层实现会有所差异,比如gateTask等是用disable enable task管理task间资源互斥,gateMutex是通过semaphore来是实现资源互斥,具体差异参考sysbios user guide。