Can anybody give some general examples of usage of spinlock where mutexes cannot be used?
Also whats the difference between the spinlock and mutex?

SpinLock- If a process cant get a particular resource it keeps continuously checking to see when the resource becomes available. Context switch does not take place. This would be useful in cases where context switch takes much more time than the actual computation done by the process
Mutexes- If a process cant get a particular resource the process goes to sleep. When the resource becomes available the some one will awaken the process. When the process goes to sleep, context switch takes place. This mechanism is used when the cost of context switch is a less as compared to the computation done in the process

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.