-aba noun

Source: Internet
Author: User

Look at the wiki today and see a mention of what's going to fall into race condition & ABA problem. Ah, I have not heard of Aba Ah, then I went to search for a bit, as follows:

Http://www.bubuko.com/infodetail-317006.html

"SpinLock spin Lock, CAS operation (Compare & Set) ABA problem"

The ABA is explained as follows:

The so-called ABA (see Wikipedia's ABA Entry), the problem is basically like this:

    1. Process P1 reads a value of a in a shared variable
    2. P1 was preempted, process P2 executed.
    3. P2 the value of the shared variable from a to B, and then to a, at this time by P1 preemption.
    4. P1 returned to see that the value in the shared variable was not changed, and then continued.

The ABA problem is most likely to occur in the lock free algorithm, with CAs taking the brunt because CAS determines the address of the pointer.

If this address is reused, the problem is huge.

You have a suitcase full of money at the airport, here comes a hot sexy beauty, then she is very warm tease you, and while you are not aware of the time,

Put a bag in an identical suitcase with your full money box, and then leave, you see your suitcase is still there, so carry a suitcase to catch a plane.

This is the problem of ABA.

The CAS operation consists of three operands-the memory location (V), the expected original value (A), and the new value (B).

If the value of the memory location matches the expected original value, the processor automatically updates the location value to the new value.

-aba noun

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.