What is the difference between a lock convoy and lock/thread contention?
There are two blocking approaches used in locking algorithms when a lock is busy. spin wait or block (go to sleep, relinquish processor and wait for OS to awake the thread and re-schedule). Lock convoy as mentioned will happen when blocking strategy is used.
OS schedule threads on a core in time-sliced manner. Every thread get the processor for some per-determined time-slice, say 2 ms. OS in a round-robin fashion schedule all the threads in the ready-queue one by one. If say a thread after it get schedule and start its execution, say after 100 us, ask for a lock. If the lock is busy, the thread unable to get the lock, blocks and relinquishes processor. So remaining 1.9ms (2ms-100us) time slice is not used by the thread. Even after it is awaken by the OS when lock is free, the thread has to wait for its turn in the round-robin queue. The number of active threads could be in 100's.
Lock contention causes convoy effect.