异步IO就是将数据从内核空间拷贝到用户空间放在了内核中进行, 所以用户进程或线程就可以在这段时间做其他事情. 这是他的优点, 但是他的缺点是什么呢?
学习是最好的投资!
I think the shortcomings are:
Multi-threaded programming is required, the threshold is high, and it is easy to write low-quality code.
Synchronous serial programming is easier to understand than asynchronous callbacks.
The code of asynchronous IO is relatively complex and not intuitive enough.
Recommended to take a look at RxJavaAsynchronous programming, and you don’t have to deal with thread issues yourselfIf combined with lambda expressions, the logic is clear and the code is simple
I think the shortcomings are:
Multi-threaded programming is required, the threshold is high, and it is easy to write low-quality code.
Synchronous serial programming is easier to understand than asynchronous callbacks.
The code of asynchronous IO is relatively complex and not intuitive enough.
Recommended to take a look at RxJava
Asynchronous programming, and you don’t have to deal with thread issues yourself
If combined with lambda expressions, the logic is clear and the code is simple