微服务中的"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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • a.《你走了以後》(After You'd Gone)瑪吉•奧法雷(Maggie O'Farrell) b.《燃燒...
    蘿卜阅读 1,053评论 0 0
  • 不要让别人扼杀了你的奇思妙想 这个世界上,一定有人在做着我们不敢做的事,过着我们想要的生活。极致的幸福,存在于孤独...
    云渺渺阅读 1,898评论 0 2