微服务中的"thread pool and callback hell"问题

thread pool hell

this post content

  • some of the basics of asynchronous programming,
  • the tools that are available in Play 2.1 and Scala,
  • the patterns that make it easy to manage non-blocking code.

web frameworks handle concurrent requests, I/O, and threads.

  • Threaded: Servlets, Ruby on Rails, Django, PHP
  • Evented: Play, Node.js, Twisted

Threaded

  • it’s easy for all of them to become tied up waiting for I/O, preventing any new requests from being processed even though most of your threads are just idly waiting.

Evented

  • even a single long calculation or accidental blocking I/O call can bring an Evented server to its knees.

Furture的组合

Java线程模型/执行流程
Java线程池机制

http://mmcgrana.github.io/2010/07/threaded-vs-evented-servers.html

https://engineering.linkedin.com/play/play-framework-async-io-without-thread-pool-and-callback-hell

https://www.zhihu.com/question/31440152

你可能感兴趣的:(微服务中的"thread pool and callback hell"问题)