synchronous VS asynchronous

      In a synchronous call to a method, the caller thread blocks while the call is active. When the call completes, the method can return results through the return value of the method or through any out parameters of the method. Because the call is synchronous, the caller code is guaranteed that the call has completed and so the caller code is assured that the values returned are valid (as long as the method is bug-free).
      When a thread makes an asynchronous call to a method, the call returns immediately. The caller thread is not blocked; it is free to perform some other task. The infrastructure obtains a thread for the method invocation and delivers the in parameters passed by the calling code. This async thread can then run the method in parallel to the calling thread. If the method generates some data and returns this value, the calling thread must be able to access this data. The .NET asynchronous infrastructure supports two mechanisms: the calling thread can either ask for the results, or the infrastructure can deliver the results to the calling thread when the results are ready.

posted @ 2010-06-01 16:45  Ada.color  阅读(176)  评论(0)    收藏  举报