aiqier
V2EX  ›  编程

nio 多路复用使用线程池的一个疑问?

  •  
  •   aiqier · May 20, 2020 · 3352 views
    This topic created in 2210 days ago, the information mentioned may be changed or developed.

    常常会将线程池模型和多路复用模型进行对比,多路复用模型一个线程就能 hold 住所有链接,不需要像多线程模型那样造成线程切换,但是在真实使用多路复用模型的时候,都会搭配一个 work 线程池来对返回结果进行处理,多路复用只用来监听链接,那么这不就又回到多线程模型了么,这个 work 线程池难道不会造成上下文切换么?还是说这个 work 线程池的上下文切换很小和线程池大小也很小?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2918 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:00 · PVG 23:00 · LAX 08:00 · JFK 11:00
    ♥ Do have faith in what you're doing.