What is thread contention?

后端 未结 10 965
[愿得一人]
[愿得一人] 2020-11-27 09:53

Can someone please explain simply what thread contention is?

I have googled it, but cannot seem to find a simple explanation.

10条回答
  •  没有蜡笔的小新
    2020-11-27 10:19

    From here:

    A contention occurs when a thread is waiting for a resource that is not readily available; it slows the execution of your code, but can clear up over time.

    A deadlock occurs when a thread is waiting for a resource that a second thread has locked, and the second thread is waiting for a resource that the first thread has locked. More than two threads can be involved in a deadlock. A deadlock never resolves itself. It often causes the whole application, or the part that is experiencing the deadlock, to halt.

提交回复
热议问题