Reprinted article address: https://blog.csdn.net/weixin_39833509/article/details/88603957 [Learn to use collection reprint, if you have any questions, please contact me to delete]
---------------------------------------------------------
Reprinted weixin_39833509 last published on 2019-03-16 19:30:29 Reading number 5459 collection
Is an http request a thread? Is java service a new thread for processing every time a request is received?
The answer is: yes, an http request is just a thread.
https://blog.csdn.net/elvis_lfc/article/details/53466877
https://blog.csdn.net/h12kjgj/article/details/55063956
=== Summary
1http请求,就是来银行办理业务的用户。
- 1
2tomcat is the bank
3 A thread is to open a window
5 threads are shared CPU, so multi-threading can improve processing speed than single thread?
For example, a window (a CPU), three people to handle business.
Single thread: one after another.
Multi-threading: Everyone will do it in turn, I will do it for you later, you will do it for him later.
But single-threaded, multi-threaded, the same time-consuming. Does not improve efficiency, so why do you say that multithreading is more efficient than single threading?