C # begin & End.

Source: Internet
Author: User

Begin & End

1.
At the begin, it should be only registered events. and IO do not intersect, immediately entered the next statement.
The callback event, if not triggered, does not immediately thread to execute the callback method.

2.
When receiving a connection, or data, from generally speaking, it should be the operating system that immediately wakes up the suspended thread.
and begin & End, the test found that no threads were suspended, then the estimate is that the. NET Framework has helped us start a new thread hanging up on the wait Io, so vs doesn't know.
Once the data arrives, the operating system wakes up the. NET Framework thread, and this thread immediately executes the event that we registered in begin.

3.
End
The internet says the thread hangs on the end. Break point found. There is no thread hanging up on end. This one.........

Therefore, begin registers only events. When there is a corresponding event triggered, there will be another thread calling the callback function, and when executed to end, there may be some unspeakable things to deal with.
Instead of begin, the thread executes the callback immediately and hangs over the end.

4,

Observing the run time of the next vs thread, guess that the. NET thread hangs on the wait IO instead of our end. There is an event that invokes the registered event.

C # begin & End.

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.