vbuhr
vbuhr

Reputation: 73

(Terminology) "Contended" vs "Contented" Locks

What is the difference, if any, when talking about "contented" locks and "contended" locks.

I recently heard the word "contented" used for the first time in a discussion about locking and evidently the two terms are used with almost equal frequency:
contented 367,000 results
contended 353,000 results

"Contention" and "contended" make sense to me, as they are words meaning in conflict, but "contented" means satisfied/at peace, so color me confused.

Upvotes: 7

Views: 2532

Answers (2)

Nathan Hughes
Nathan Hughes

Reputation: 96434

"Contended" describes a lock that different threads are trying to acquire at the same time, "Heavily-contended" if numerous threads are all trying to acquire the same lock, "uncontended" describing cases where a thread doesn't have any competition to acquire a lock.

"Contented" might be a typo, an erroneous autocorrect, or maybe an eggcorn).

Here's an example from the Oracle website, on the weblog of David Dice, a senior research scientist in Oracle who specializes in concurrency applications. If "contented" had a meaning specific to locks or multithreading I expect he would know about it. The contented typo appeared in his weblog (it's been corrected in the article text but it remains in the article url), someone commented on seeing "contented". David Dice replied:

Thanks for catching the embarrassing typo, which I just fixed! Like you, I wonder exactly what the semantics of "@contented" would mean (:>). Regards, -Dave

For some of these results Google seems to be anticipating our inability to spell. Google returns this link on the first page of matches for "contented site:oracle.com", even though the word "contented" does not appear in it.

Upvotes: 11

David Seged
David Seged

Reputation: 1

Locks are either contended or uncontended. A lock is considered contended if a thread blocks while trying to acquire the lock. If a lock is available when a thread attempts to acquire it, the lock is considered uncontended. Con- tended locks can experience either high contention (a relatively large number of threads attempting to acquire the lock) or low contention (a relatively small number of threads attempting to acquire the lock.) Unsurprisingly, highly contended locks tend to decrease overall performance of concurrent applications.

Upvotes: 0

Related Questions