SmartDSP OS Mutexes and spinlocks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SmartDSP OS Mutexes and spinlocks

649 Views
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 Kudos
Reply
1 Reply

373 Views
Mick92
Contributor I

Hi,

 

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

 

Regards,

0 Kudos
Reply