Answer:
Assume that a context switch takes T time. Suggest an upper bound (in terms of T) for holding a spinlock. If the spinlock is held for any longer, a mutex lock (where waiting threads are put to sleep) is a better alternative.
Explanation:
The top limit is to be twice the value of (2xT). Holding the spinlock for a longer time, it will be necessary to put the thread to sleep and get a context switch, so one process awakes the sleeping thread without the need of a second context switch.
In process synchronization, cooperating process can affect or be affected by other processes executing in the system, either directly share a logical address space, both code and data, or be allowed to share data only through files or messages, although concurrent access to shared data may result in data inconsistency. But there are several mechanisms to help the orderly execution of cooperating processes that share a logical address space, so that data consistency is kept.