You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

796 B

Input Output

-行对于内存的操作读写 img.png

  • read() Input
  • write() output

一些面试基础题目

img_1.png img_2.png

BIO

  • blockIO阻塞式IO线程阻塞
  • serverSocket.accept();等待请求
  • img_5.png

nio

-主要用块效率高, io主要用流效率低

  • 非阻塞面向缓冲,有选择器
  • 可以利用线程管理通道 select监听端口数据

AIO 异步IO

  • 把事件交给操作系统

Netty

  • 基于NIO的框架,多线程架构

Reactor 监听请求=select+dispathch

  • 用来监听接收客户端请求
  • 连接客户端
  • acceptor获取连接
  • Handler 处理业务 可以在线程池多处理
  • 有多种模型单线程,多线程,多进程 multi-reactor