Blocking and deadlock

Source: Internet
Author: User

Blocking and deadlock are two different concepts.
For example, there are threads 1 and 2, thread 1 occupies resource A, and thread 2 occupies resource B. At this time, thread 2 needs to use resource A to continue, but resource A is occupied by thread 1, so thread 2 can only wait for resource A to be released by thread 1, which is called thread 2 being blocked.
However, if thread 1 may require resource B to continue at this time, both threads will wait for the other party to release the resource, which is a deadlock.
To put it simply, blocking is generally not called cyclically, and deadlocks are called cyclically.

The following content is for your reference:
Understand and solve SQL Server 7.0 or 2000 blocking Problems
Http://support.microsoft.com /? Id = 224453

Blocking cannot be avoided. As long as a concurrent task is executed, this phenomenon may occur.
Deadlock should be avoided. The main method is to writeProgramWhen you try to use a variety of methods to avoid loop calls, and set a maximum wait time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.