By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,775 Members | 1,353 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,775 IT Pros & Developers. It's quick & easy.

C# on multicore

P: n/a
Hi,

I'm a newbie to C# and I haven't dig into multi-threading in .net (I have
some experience with MT in delphi and c++).
Let's say I have one of these new pentium D multicore. If I start a program
that has 2 threads, will they execute each in a different core? Is there any
support in the language to control in which CPU a thread will execute?
In a more general sense, how .net uses multi-core/multi-cpu systems?

Cheers

Padu
May 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello Padu,

use Process.ProcessorAffinity to set which CPU each tread need to use
or create thread pool for each processor

P> I'm a newbie to C# and I haven't dig into multi-threading in .net (I
P> have
P> some experience with MT in delphi and c++).
P> Let's say I have one of these new pentium D multicore. If I start a
P> program
P> that has 2 threads, will they execute each in a different core? Is
P> there any
P> support in the language to control in which CPU a thread will
P> execute?
P> In a more general sense, how .net uses multi-core/multi-cpu systems?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 18 '06 #2

P: n/a
Hello Padu,

BTW, if you are starting you app in SMP box (2 CPU) you CLR start works in
server mode and its responsible for CPU thread management

P> I'm a newbie to C# and I haven't dig into multi-threading in .net (I
P> have
P> some experience with MT in delphi and c++).
P> Let's say I have one of these new pentium D multicore. If I start a
P> program
P> that has 2 threads, will they execute each in a different core? Is
P> there any
P> support in the language to control in which CPU a thread will
P> execute?
P> In a more general sense, how .net uses multi-core/multi-cpu systems?
P> Cheers
P>
P> Padu
P>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.