Multi-threading and asynchronous programming have always been small white into a (-) hurdle. Usually also used a lot of multi-threading and asynchronous operations, here to record.
The concept of async and multithreading
You may meet the need to crawl Web data, this time if the data is very large. Then a single thread will cause a wait. If you use thread threads at this time, it will prevent the UI line from incurring, but it will still be slow. This is the typical multithreaded error usage scenario.
So what do we need to do to deal with this scenario? The first thing to understand is the operation of Web data, IO operations.
IO operation: An IO stream is actually an unstructured sequence of bytes or sequences of characters that are inserted and removed as IO operations. Are the operations that are based on the IO stream.
Dma:direct Memory Access, is the mode of IO operation. Direct memory access is a mode of data interaction that does not go through the CPU. Does not deplete CPU resources.
Asynchronous difference: Async is the full use of the DMA function to release CPU pressure.
C # Multi-Threading vs. async