471,349 Members | 1,127 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Multi processors and the CLR

I know Windows / SQL etc can utilise multiple processors. In the good old
days of coding, you simply wrote the .EXE and Windows would run it on a
single processor (or a given processor for multi-processor machines)

I know also that threads exist, but am having a few problems understanding
how they are split across processors so here is an easy example.

I have a VB.Net written application that is processor intensive. It has not
been coded in any particular way to support multiple processors, or to
create multi threads.

When I run it on a dual processor machine (running 2003 server Ent Edition),
is the CLR able to spread the code execution across more than 1 processor?
Or does it just pick on a single processor and stick with it for the life of
the .Exe?
Any help most welcome.
Jul 21 '05 #1
2 1972
John,
the CLR cannot magically figure out which functions in your code can be
safely executed on seperate threads so everything will execute on the main
thread or at least give the impression that it is.

The runtime makes it fairly easy to create new threads using
System.Threading.Thread and the ThreadPool class and provides all the
necessary synchronistion primitives.

For a more "magical" way in which this might all work, you can take a look
at a research project call Polyphonic C#
http://research.microsoft.com/~nick/polyphony/
which has explicit concurrency directives in the language.

Regards
Niroo TP [MSFT]

Regards
Niroo

"JohnFol" wrote:
I know Windows / SQL etc can utilise multiple processors. In the good old
days of coding, you simply wrote the .EXE and Windows would run it on a
single processor (or a given processor for multi-processor machines)

I know also that threads exist, but am having a few problems understanding
how they are split across processors so here is an easy example.

I have a VB.Net written application that is processor intensive. It has not
been coded in any particular way to support multiple processors, or to
create multi threads.

When I run it on a dual processor machine (running 2003 server Ent Edition),
is the CLR able to spread the code execution across more than 1 processor?
Or does it just pick on a single processor and stick with it for the life of
the .Exe?
Any help most welcome.

Jul 21 '05 #2
Niroo, many thanks for the clarification.
"Niroo TP" <Ni*****@discussions.microsoft.com> wrote in message
news:C2**********************************@microsof t.com...
John,
the CLR cannot magically figure out which functions in your code can be
safely executed on seperate threads so everything will execute on the main
thread or at least give the impression that it is.

The runtime makes it fairly easy to create new threads using
System.Threading.Thread and the ThreadPool class and provides all the
necessary synchronistion primitives.

For a more "magical" way in which this might all work, you can take a look
at a research project call Polyphonic C#
http://research.microsoft.com/~nick/polyphony/
which has explicit concurrency directives in the language.

Regards
Niroo TP [MSFT]

Regards
Niroo

"JohnFol" wrote:
I know Windows / SQL etc can utilise multiple processors. In the good old
days of coding, you simply wrote the .EXE and Windows would run it on a
single processor (or a given processor for multi-processor machines)

I know also that threads exist, but am having a few problems
understanding
how they are split across processors so here is an easy example.

I have a VB.Net written application that is processor intensive. It has
not
been coded in any particular way to support multiple processors, or to
create multi threads.

When I run it on a dual processor machine (running 2003 server Ent
Edition),
is the CLR able to spread the code execution across more than 1
processor?
Or does it just pick on a single processor and stick with it for the life
of
the .Exe?
Any help most welcome.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Thomas Womack | last post: by
37 posts views Thread by ajikoe | last post: by
1 post views Thread by Eugene | last post: by
2 posts views Thread by JohnFol | last post: by

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.