PV operation, I finally understand you!

Source: Internet
Author: User

last week, Miss Rice gave us a lecture is really wonderful! I finally have their own understanding of the PV operation. Have not understood the PV operation before, now summarize, for the next stage to learn and summarize.

Why is it called PV operation? The reason: This is Dixtra is defined in Dutch, because in the Dutch, by calling Passeren, release called VRIJGEVEN,PV Operation so named.



at first glance, this picture shows no one knows what I want to explain. I would like to use this picture to explain to you the PV operation!
In the middle of this bold black line is scale beam, just like the upper and lower control power switch in our life! There are only two states, one is up and one is down.
The picture above is the consumer (son), for the consumer, it is only responsible for observing the V signal, that is, the scale beam above the sign v signal;
Below this picture is the producer (father), for the producer, it is only responsible for observing the p signal, that is, the scale beam below the flag P semaphore.
Description: Scale beam away from which the signal volume is 1, which is near, its signal volume of 0
Run:
When the scale beam is at a, the V signal is a 0,p semaphore of 1 and at B, the V signal is a 1,p semaphore of 0.
Suppose there is a case of scale beam at C, which is instantaneous, and both V and P have a semaphore of 0.

When the scale beam position is higher than C, the P-1 is not less than 0, can carry out P operation, and the V signal volume plus 1,PV operation is completed, the scale beam position is less than C, the P signal is 0,v signal volume of 1, after the consumer PV operation, the same, P-1 not less than 0, (at this time the P signal is for the consumer, Because the producer has already produced one, so the consumer's P-signal volume is 1, the equivalent of the producer's V signal volume. ) can do p operation, while the V signal volume plus 1,PV operation is completed, the scale beam position is higher than C, the p signal is 1,v signal volume of 0, and then the producer for PV operation.


Features of PV operation:
Atomicity, p and V operations are not divided!
Continuity, p and V operations are uninterrupted.
P himself, v each other: P is its own signal volume minus 1,v is the other's signal volume plus 1.

PV operation, I finally understand you!

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.