473,513 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# on multicore

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
2 6205
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2160
by: Ioannis Vranos | last post by:
Since multicore processors are about to become mainstream soon, multithreading will become a main concern too. However I am thinking that perhaps for small/medium-sized applications...
3
1792
by: threadman | last post by:
Cilk Arts has published a free e-Book: "How to Survive the Multicore Revolution (or at Least Survive the Hype)" the ebook covers: - Background on the emergence of mainstream multicore processors...
1
2649
by: threadman | last post by:
http://www.cilk.com/multicore-e-book New e-Book: "How to Survive the Multicore Revolution (or at Least Survive the Hype)" the ebook covers: - Background on the emergence of mainstream...
6
2569
by: cnb | last post by:
If I buy a multicore computer and I have really intensive program. How would that be distributed across the cores? Will algorithms always have to be programmed and told specifically to run on...
20
2138
by: gremlin | last post by:
http://www.cilk.com/multicore-blog/bid/6703/C-Inventor-Bjarne-Stroustrup-answers-the-Multicore-Proust-Questionnaire
0
1816
by: gremlin | last post by:
http://www.cilk.com/multicore-blog/bid/6703/C-Inventor-Bjarne-Stroustrup-answers-the-Multicore-Proust-Questionnaire
0
1261
by: Chris M. Thomasson | last post by:
http://groups.google.com/group/comp.programming.threads/browse_frm/thread/a4a668e20be49644 ] "gremlin" <gremlin@rosetattoo.comwrote in message
4
2028
by: Chris M. Thomasson | last post by:
http://groups.google.com/group/comp.programming.threads/browse_frm/thread/e753228b20889a11 ] "Dmitriy V'jukov" <dvyukov@gmail.comwrote in message...
0
1213
by: Cilk | last post by:
We at Cilk Arts are soon (Jan '09) going to release Cilk++ 1.0, with the goal of delivering the easiest, quickest, and most reliable way to maximize application performance on multicore processors....
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.