知识卡片
每请求线程换取简单编程
每请求线程架构TRA让一个线程完成该请求全部步骤,包括阻塞等待外部服务。程序顺序与调试直观,现成框架支持多,但等待时线程不能做其他工作;池耗尽后新请求排队。CPU密集任务线程可接近核心数,I/O多时增加线程会引入更多上下文切换,具体数量需压测而非照搬书中倍数。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 服务端架构 · 查看原书依据
With TRA architecture, a single thread does all the work for a single request. Figure 11.1 assumes each request has three work items. All work items in each request are assigned to one thread.
参考来源
- 位置:《Software Architecture and Decision-Making》第11章《Server Architectures》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch11.xhtml)
- 结论依据:摘录说明每请求线程架构TRA让一个线程完成该请求全部步骤,包括阻塞等待外部服务。其余条件结合本章相邻例子与取舍说明,数字示例不作当前性能承诺。
- 原始内容:With TRA architecture, a single thread does all the work for a single request. Figure 11.1 assumes each request has three work items. All work items in each request are assigned to one thread.