Global Sources
EE Times-India
 
EE Times-India > EDA/IP
 
 
EDA/IP  

Implementing memory-based mutex primitive in multi-processor system

Posted: 25 Sep 2008     Print Version  Bookmark and Share

Keywords:multi-processor  synchronisatioN  mutual exclusion 

Programming multi-processor systems often requires that the tasks running on the processors be able to synchronise with each other and be able to safely access shared data. To enable multi-processor synchronisation and data sharing via a shared memory, the Xtensa architecture includes several multi-processor synchronisation instructions.

This application note describes how multi-processor synchronisation primitives can be implemented on Xtensa processors. This document specifically discusses how a memory-based mutual exclusion (mutex) (also referred to as a lock) primitive can be implemented in a multi-processor system. Included with this application note is the complete source code for a C/C++ library that implements an example mutex and barrier API.

A mutex is useful for protecting shared data structures from concurrent modifications, and for implementing critical sections and monitors. A mutex has two possible states: unlocked (not owned by any core/thread), and locked (owned by one core/thread). A mutex can never be owned by two different threads simultaneously. A thread attempting to lock a mutex that is already locked by another thread is blocked until the owning thread unlocks the mutex. The thread that has locked a mutex is said to own the mutex.

A barrier is a synchronisation primitive that requires a specified number of threads to wait at the barrier before any of the threads are allowed to proceed. A barrier can be used to synchronise multiple threads to ensure that all threads have completed a part of an application before proceeding to the next part.

View the PDF document for more information.





Comment on "Implementing memory-based mutex prim..."
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 

Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

 
Back to Top