473,729 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2112
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.Threadin g.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*****@discus sions.microsoft .com> wrote in message
news:C2******** *************** ***********@mic rosoft.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.Threadin g.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
7446
by: Thomas Womack | last post by:
If I have a dual-processor hyperthreaded machine (so with four CPU contexts), will a python program distribute threads over all four logical processors? I ask because I'm fairly sure that this *does* happen using the threading extensions in MFC, and fairly sure that it *doesn't* when using Java, so I don't see that the result is obvious for python. Tom
37
4891
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo
77
5368
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for the moment. I'd be *very* grateful if people with any interest in multi-threading would read it (even just bits of it - it's somewhat long to go through the whole thing!) to check for accuracy, effectiveness of examples, etc. Feel free to mail...
3
3148
by: Amit Dedhia | last post by:
Hi I am developing a Dot net application (involving image processing) on a uni processor. It works well on my machine. I then take all my code on a multi processor, build and run the application there. There is performance degradation. The usual performance of the application on MP machine is better than that of uni processor machine. But the performance of MP degrades when it comes to the multi-threaded part of the application. I am...
4
2310
by: DMAC | last post by:
Hi, Ive been told this, but I hope it is NOT true. I have an sql server2000 installation running on a server that has four processors. It is on a active network but is not the domain controller so essentially it is fully dedicated to servicing the needs of sql server, (a bit of browsing, a bit of ms Office, but almost wholly dedicated to sqlserver. Now, the big question, why, when the server properties have been set to utilize all four...
1
1416
by: Eugene | last post by:
Hi All, In multi processor computer, do we need to use specific design/coding method to optimize our program to take advantage of the multi processor? If I use a normal program, would it automatically achieve better (maybe significantly) performance by adding more cpu(s). By using special techniques (targeting multi processor sys), would the performance be increased further? If yes, what is those techniques?
2
327
by: JohnFol | last post by:
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...
5
1815
by: shumaker | last post by:
I just read an overview of C# 3.0, and it occured to me that some of these features could make it much easier to write programs that automatically make use of multi core processors. After reading that lambda functions are available in 3.0, I read up on the advantages of functional programming, and one of the advantages is that tasks performed in a functional language do not have side effects, and thus tasks can be divided between...
5
1946
by: Coaster | last post by:
I am designing a process which will spawn a good number of threads and some of them will execute a c++ process which is quite memory intensive (although not multithreaded). This will run on a 2 cpu (both dual core) server. What do I need to do if anything in order to spread the workload across the cpu's / cores in order to tune it properly? I googled it and found this post but its somewhat dated and didn't know if it applied to 2.0
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
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 we have to send another system

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.