SmartDSP OS Mutexes and spinlocks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SmartDSP OS Mutexes and spinlocks

790 次查看
zpyatt
Contributor II

Hi again,

 

So I need to implement mutual exclusion and I quickly found out the EWL c/c++ mutexes are not implemented for the Starcores, and so I turned to the spinlock of the SmartDSP OS; however, it appears the spinlock is only for mutual exclusion of a shared resources amongst cores:

 

"Spinlocks should be used only when data is shared between cores." - from the SmartDSP_OS_User_Guide.pdf, 14 June 2011

 

I need mutual exclusion of a resource shared between tasks and ISRs on the same core in this case.  So far I haven't seen anything to do this.  I'm thinking I will make my own mutex using the bmtset intrinsic or the bmtset.w assembly instruction.

 

Comments/suggestions?  Am I missing something/making it harder than it needs to be?

 

Thanks,

zpyatt

 

Oh yeah the setup is: CodeWarrior 10.1.5, MSC8144, SmartDSP OS, using C++

 

0 项奖励
回复
1 回复

514 次查看
Mick92
Contributor I

Hi,

 

Mutexes are binaries semaphores, you can use a semaphore initialized to 1.

 

Regards,

0 项奖励
回复