SpinLocks usage example

Give me an example where only the spinlocks can be used and no mutexes.

Google, Ask Jeeves and Bing all give good answers when given your post.

For example the bottom half implementation of any Linux driver code need to use the spinlock instead of mutex (or any seamaphores for that maters), otherwise contex switch in seamaphore based synchronization proves to be too expensive. However, there is also some pitfalls associated with spinlock based implementations (specially any application going to be used as server and need to handle high connection rates should avoid spinlock() ).

Please look at the Rubini's Linux Device Driver ebook for a better and a detailed discussion.