avatar
c*o
1
A situration like this:
1) Application A has 2 threads running
2) Each thread is running a public method of class B,
3) in the public method of class B, it is using an instance
of Class C to do some parsing work which takes a long time ( a few seconds)
instance of C is labeled ThreadStatic
When running on a single-CPU computer, since only one thread can run
concurrently, there is no problem. Issue comes in when running on a
quad-CPU box and 2 threads are running concurrently. The instances of
cl
avatar
g*y
2
if class C is a parsing function, why do you want to make it thread static?

【在 c******o 的大作中提到】
: A situration like this:
: 1) Application A has 2 threads running
: 2) Each thread is running a public method of class B,
: 3) in the public method of class B, it is using an instance
: of Class C to do some parsing work which takes a long time ( a few seconds)
: instance of C is labeled ThreadStatic
: When running on a single-CPU computer, since only one thread can run
: concurrently, there is no problem. Issue comes in when running on a
: quad-CPU box and 2 threads are running concurrently. The instances of
: cl

avatar
G*o
3
use Application Domain

【在 c******o 的大作中提到】
: A situration like this:
: 1) Application A has 2 threads running
: 2) Each thread is running a public method of class B,
: 3) in the public method of class B, it is using an instance
: of Class C to do some parsing work which takes a long time ( a few seconds)
: instance of C is labeled ThreadStatic
: When running on a single-CPU computer, since only one thread can run
: concurrently, there is no problem. Issue comes in when running on a
: quad-CPU box and 2 threads are running concurrently. The instances of
: cl

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。