写在前面
自从介入UI界面编程以后,就免不了使用多线程处理问题,而一直一直以来却并没有仔细了解多线程和异步究竟有什么区别,这篇文章就以现在的认知来聊一聊。
异步编程是怎么运行的?
阅读
来看一篇文章
Asynchronous programming is a bit more general in that it has to do with latency (something on which your application has to wait, for one reason or another), whereas multithreaded programming is a way to achieve parallelization (one or more things that your application has to do at the same time). That said, the two topics are closely related; an application that performs work on multiple threads in parallel will often need to wait until such work is completed in order to take some action (e.g. update the user interface). So, this idea of waiting is the more general characteristic that is referenced by the term asynchronous, regardless of thread count.
异步