线程与线程池 [英] Threads vs Thread Pool

查看:87
本文介绍了线程与线程池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

幻数25只适用于线程池吗?它是否也适用于手动创建线程?

解决方案

它仅适用于线程池而不是线程。线程池大小

也可以从25更改为更大的数字。


" Naveen" < NA ********************* @ gmail.com>在消息中写道

news:11 ********************** @ i40g2000cwc.googlegr oups.com ...

它仅适用于线程池而不适用于线程。线程池大小
也可以从25更改为更大的数字。




线程池中的默认上限是每个处理器25个线程*所以在一台2 $ / $
的处理器机器默认为50.但是,在v2.0中你可以通过ThreadPool.SetMaxThreads()更改线程池所覆盖的线程的数量


电话。


问候


Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


< blockquote> 25只是一个默认值,你可以配置它。至于你自己的主题,你可以继续创建任意数量的内容......直到你让机器崩溃,

是。 :-)


-

Gregory A. Beamer


********* ****************************************

外面思考盒子!

*************************************** **********

" vzaffiro" <六************* @ gmail.com>在消息中写道

新闻:11 ********************** @ j73g2000cwa.googlegr oups.com ...

幻数25只适用于线程池吗?它是否也适用于手动创建线程?



Does the magic number of 25 only apply to the thread pool? Does it also
apply to manually creating threads?

解决方案

It applies only to thread pool and not to threads. The threadpool size
also can be changed from 25 to a greater number.


"Naveen" <na*********************@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...

It applies only to thread pool and not to threads. The threadpool size
also can be changed from 25 to a greater number.



The default cap in the thread pool is 25 thread *per processor* so on a 2
processor machine it defaults to 50. However, in v2.0 you can change the
number of threads the thread pool caps to via the ThreadPool.SetMaxThreads()
call.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk


25 is just a default and you can configure it. As for your own threads, you
can keep creating as many as you want ... until you crash the machine, that
is. :-)

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"vzaffiro" <Vi*************@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...

Does the magic number of 25 only apply to the thread pool? Does it also
apply to manually creating threads?



这篇关于线程与线程池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆