正在加载图片...
●●● ●●●● 4.4 Threading issues ●●●●● ●●● ●●●0● ●●●0 ● Thread pools Create a number of threads at process startup and place them into a pool where they wait for work When a server receives a request, it awakens a thread from the pool, and passes it the request Once the thread completes its service, it returns to the pool If the pool contains no available thread, the server waits until one becomes free Advantages o Usually slightly faster to service a request with an existing thread than to create a new thread Allows the num ber of threads in the application s to be bound to the size of the poo30 4.4 Threading Issues ⚫ Thread Pools ⚫ Create a number of threads at process startup and place them into a pool where they wait for work ⚫ When a server receives a request, it awakens a thread from the pool, and passes it the request ⚫ Once the thread completes its service, it returns to the pool ⚫ If the pool contains no available thread, the server waits until one becomes free ⚫ Advantages: ⚫ Usually slightly faster to service a request with an existing thread than to create a new thread ⚫ Allows the number of threads in the application(s) to be bound to the size of the pool
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有