B2China (Sailland Air Sky Electromagnetic) About the thread pool, I feel good, copy, 嘿嘿

zhaozj2021-02-16  79

Reply to: b2china (sea and land emission electromagnetic) () reputation: 100 2004-07-20 15:36:00 Score: 0 Thread pool technology is generally used in server side,

The server first initializes a thread pool, that is, starting N (the number of n is actually fixed, usually n> 64) thread is waiting

The client's connection request or data processing request, then these threads are in the "sleep" state, basically do not occupy

A lot of CPU or memory, once listened to the client's connection request or service request, one of them "

The idle thread tells it: "Get up, you work", so this thread starts, and set yourself.

The status is "busy", after work, it will continue to enter

"Hemaken" state until the next request arrives. If all thread pools thread work hard, they are busy.

Then the server sends the "service side" to the client.

What kind of do you do this: It is to save the time when the client requests arrives, and the server is in a hurry to create a thread time, and repeatedly created, clean up the thread consumption CPU, and the memory resources are also very large. The biggest advantage is to achieve efficient concurrent server operations.

转载请注明原文地址:https://www.9cbs.com/read-14760.html

New Post(0)