The difference between horizontal and edge triggering

Source: Internet
Author: User

Horizontal triggering (level-triggered, also known as conditional triggering) LT:triggers an event whenever a condition is met (the kernel keeps you informed as long as the data is not being fetched)

Edge Trigger (edge-triggered) ET: an event is triggered whenever the state changes.
"to read the socket example, assume that after a long period of silence, there are now 100 bytes, and both the edge trigger and the conditional trigger will produce a read Ready notification notification application. The application reads 50 bytes and then calls the API again to wait for the IO event. The condition-triggered API will now return the user to a read ready notification because it is still 50 bytes readable. The edge-triggered API is stuck for long waits because the readable state does not change. So when using edge-triggered APIs, be aware that each time you read the socket back to ewouldblock, otherwise the socket is obsolete. When using the conditional-triggered API, do not focus on the socket writable event if the application does not need to write, or it will return a write ready notification an unlimited number of times. We commonly use SELECT is a conditional trigger this category, long-term concern socket write event will appear CPU 100% problem.

The difference between horizontal and edge triggering

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.