java - 异步IO的优缺点
PHPz
PHPz 2017-04-18 10:12:10
0
2
558

异步IO就是将数据从内核空间拷贝到用户空间放在了内核中进行, 所以用户进程或线程就可以在这段时间做其他事情. 这是他的优点, 但是他的缺点是什么呢?

PHPz
PHPz

学习是最好的投资!

reply all(2)
洪涛

I think the shortcomings are:

  1. Multi-threaded programming is required, the threshold is high, and it is easy to write low-quality code.

  2. Synchronous serial programming is easier to understand than asynchronous callbacks.

  3. The code of asynchronous IO is relatively complex and not intuitive enough.

Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template