AnsweredAssumed Answered

SmartDSP OS Mutexes and spinlocks

Question asked by zpyatt on May 9, 2012
Latest reply on Jun 27, 2012 by Mickaël MENARD

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?





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