SmartDSP OS Mutexes and spinlocks

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SmartDSP OS Mutexes and spinlocks

652件の閲覧回数
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 返信

376件の閲覧回数
Mick92
Contributor I

Hi,

 

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

 

Regards,

0 件の賞賛
返信