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.