473,804 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyper-threading

My application uses multiple-threads and is a kind of AI simulation or
ALife. This works fine but I was wondering if and how one can make use
of hyper-threading in C#?
Thanks for any hint, Francois

_______________ _____________
The Netron Project,
http://netron.sf.net

Nov 16 '05 #1
21 6633
Illumineo wrote:
My application uses multiple-threads and is a kind of AI simulation or
ALife. This works fine but I was wondering if and how one can make use
of hyper-threading in C#?


.NET threads are mapped on OS threads, so the OS will schedule these
threads and therefore if hyperthreading is enabled, the threads will
take advantage of that.

FB
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #2
Just a silly question: How do I enable hyperthreading? Is this an option in
the C# project or an option I have to set somewhere in the control panels or
is this a build in feature of the processor?

Ciao
Dante

"Frans Bouma [C# MVP]" <pe************ ******@xs4all.n l> schrieb im
Newsbeitrag news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
Illumineo wrote:
My application uses multiple-threads and is a kind of AI simulation or
ALife. This works fine but I was wondering if and how one can make use
of hyper-threading in C#?


.NET threads are mapped on OS threads, so the OS will schedule these
threads and therefore if hyperthreading is enabled, the threads will
take advantage of that.

FB
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Nov 16 '05 #3
Thanks for the answers.

Well, then hyperthreading is just an eye catcher: As long I have a
hyperthreading CPU and an application with threats I get the Hyperthreading
technology for free, am I right?

Hyper, hyper...
"Wayne" <Me******@commu nity.nospam> schrieb im Newsbeitrag
news:ed******** *****@TK2MSFTNG P12.phx.gbl...
However, if it wasn't enabled when you installed windows I don't believe you will have the correct HAL and therefore may not be able to take full
advantage of the multi CPU's. You will need to install the correct one once you enable HT.

In Device manager you expand the Computer node, if you see multiprocessor PC (or something that indicates more than one CPU) you are fine. However, if
you see Uniprocessor PC, you'll want to go to it's properties and update
driver. Choose the driver manually to install. You will want to use the
Multiprocessor driver that matches the uniprocessor driver you have, in my
case it is an ACPI driver. Be sure you don't select the wrong one.

In the past I did some experimenting and found I could go from Multi to Uni in my machine, but was unable to go back to multi. Hopefully it was because I switched from one to the other. If you can't upgrade the driver to get the multi, you will need to reinstall windows with the HT enabled.

If all goes well you should see two CPU windows in the performance tab of
the Task Manager.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Ollie Riches" <ol**********@p honeanalser.net > wrote in message
news:#I******** *****@TK2MSFTNG P15.phx.gbl...
hyper threading is enable by in the BIOS setting of the machine
--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
"Dante" <no****@thank.y ou> wrote in message
news:OF******** ******@TK2MSFTN GP10.phx.gbl...
Just a silly question: How do I enable hyperthreading? Is this an
option in
the C# project or an option I have to set somewhere in the control
panels
or
is this a build in feature of the processor?

Ciao
Dante

"Frans Bouma [C# MVP]" <pe************ ******@xs4all.n l> schrieb im
Newsbeitrag news:Oi******** ******@TK2MSFTN GP09.phx.gbl...
> Illumineo wrote:
> > My application uses multiple-threads and is a kind of AI

simulation or > > ALife. This works fine but I was wondering if and how one can make use > > of hyper-threading in C#?
>
> .NET threads are mapped on OS threads, so the OS will schedule these
> threads and therefore if hyperthreading is enabled, the threads will
> take advantage of that.
>
> FB
>
>
> --

------------------------------------------------------------------------
> Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com > My .NET blog: http://weblogs.asp.net/fbouma
> Microsoft MVP (C#)

------------------------------------------------------------------------



Nov 16 '05 #4
Dante,

Beside your application there are a lot of other applications active.

You don't need to use an application with threads to have the benefit.

Cor
Nov 16 '05 #5
Ok, granted. I think even without my threads the application is running on
some threads.

I am just saying: If I would declare our application as hyperthreaded people
get impressed - "Wow, they are using hyperthreading technology". But in fact
we are only that HT technology because the OS is supporting it without that
I have do some tricky things to the application.
"Cor Ligthert" <no************ @planet.nl> schrieb im Newsbeitrag
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Dante,

Beside your application there are a lot of other applications active.

You don't need to use an application with threads to have the benefit.

Cor

Nov 16 '05 #6
> Ok, granted. I think even without my threads the application is running on
some threads.


No it is not.

For the rest we do agree, in a lot of cases can using threading mean more
throughput time beside that it uses forever more processor time.

Cor
Nov 16 '05 #7
Cor Ligthert <no************ @planet.nl> wrote:
Ok, granted. I think even without my threads the application is running on
some threads.


No it is not.


I disagree. Try running the following program and look at the number of
threads with something like prcview:

using System;
using System.Threadin g;

class Test
{
static void Main()
{
Thread.Sleep(50 000);
}
}

On my box at least, there are three threads in the process.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Cor Ligthert <no************ @planet.nl> wrote:
> Ok, granted. I think even without my threads the application is running on
> some threads.


No it is not.


I disagree. Try running the following program and look at the number of
threads with something like prcview:

using System;
using System.Threadin g;

class Test
{
static void Main()
{
Thread.Sleep(50 000);
}
}

On my box at least, there are three threads in the process.

I would claim that "the application" is running on only a
single thread in that case. The console has its own thread,
but that is an OS feature, beneath the application in a very
real sense, usually invisible except with tools. Likewise,
there is a thread associated with the CLR VM that does
garbage collection. The VM is also properly considered
part of the platform, not the application. (I realize this is
a fine distinction that hinges upon definitions.)

Of course, if you insist that those 3 threads are part of
the application which runs the console and VM as DLLs,
I won't quibble any further about it. <g>

--
--Larry Brasfield
email: do************* **********@hotm ail.com
Above views may belong only to me.
Nov 16 '05 #9
Larry Brasfield <do************ ***********@hot mail.com> wrote:
On my box at least, there are three threads in the process.


I would claim that "the application" is running on only a
single thread in that case. The console has its own thread,
but that is an OS feature, beneath the application in a very
real sense, usually invisible except with tools. Likewise,
there is a thread associated with the CLR VM that does
garbage collection. The VM is also properly considered
part of the platform, not the application. (I realize this is
a fine distinction that hinges upon definitions.)

Of course, if you insist that those 3 threads are part of
the application which runs the console and VM as DLLs,
I won't quibble any further about it. <g>


Given the context of the question, that's exactly what I'd say. In
terms of the number of threads running within the process - threads
which can take advantage of hyperthreading for sure - there are always
multiple threads in any .NET app. I doubt very much that the scheduler
cares whether the thread is running code written by the .NET developer
or code written by MS :)

(I don't know for sure whether hyperthreading works for multiple
processes - I suspect it would be a lot simpler not to support that at
the OS level, but I'm not an expect on hyperthreading. )

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2256
by: VIJAY KUMAR | last post by:
Hi pals, I am using 2 web forms (pages). In first page, i have Datagrid control and on second page i have a hyper link control to the first page and Add value to the data grid/Database. Problem: when I click on the hyperlink on the second page, i am getting the first page with cahed data. But i didn't declare/Use code for cache data. when i
2
1710
by: AlanHill1965 | last post by:
Hi All, I have developing a database system for the last couple of weeks and got stuck on one part of the functionality. I have posted this question over at MSDN, but no joy, perhaps they got upset about the fact I had posted to the wrong area (VBE not VBA...). Anyway The problem I have is in capturing the hyperlink used to open an MS Access database. The database (Access 2000) is used to gather the results of tests then compare them...
3
2944
by: ajaspersonal | last post by:
"i want to change font_style (hyper link<a href...>text</a>) normal to italics.when load a page" this is my problem but that label included in one 'USERCONTROL' This user controls may condain 4 link (<a href...>page1.aspx</a <br <a href ....>page2</aetc..). that will redirect another page ex:(page1.aspx).
5
21878
by: McGuard | last post by:
I am trying to send an SMS using hyper terminal in windows XP pro. I am connecting my Satellite Phone (Motorola Iridium 9505A) to my notebook via serial cable (RS232) . Below are the sample commands which I use to send an SMS to my email via Motorola 9505A. An error occurred after I press <Ctrl+Z> to execute the SMS. The message that I want to sent is: - "megat@geoid.biz testing from 9505A" Header of the message (pdu format) is: -
1
1692
by: simons | last post by:
Hi All, I'm trying to add a hyper link to one of the filed in my DataList control. I added a link button but could not bound it to an ID filed and then link it to the page that i need. I'm trying to build a news posting system running an access DB, which will link the front page with all the news headers to a news page.
0
1311
by: mclewell | last post by:
i created an html hyper link field and clicking on the data in the field produces a security warning pop up requiring a yes click before the link is activated, is there a way to turn off this specific warning?
1
4747
by: =?Utf-8?B?Q29kZVNsaW5nZXI=?= | last post by:
I plan to build my own 2008 Server/Hyper-V system and will not be using one of the tested Dell or HP systems from the release notes and could use some pointers as to my assumnptions and answers to a few questions. Some getting started with Hyper-V assumptions. Please tell me if I am off base here. 1. Any recent Intel quad core processor has the needed x64 architecture with hardware assisted virtualization and data execution protection...
1
2931
by: Kalaram | last post by:
I am makeing a CD, and in this CD i have alot of .pdf & .ppt & .pps files and i have one html page that i use as index to all the files, when i click on the hyper link of .pdf file , it opens normally. but whn i click on the hyper link of .ppt or .pps file, it shows a small windows that asks me to "open or save". can i make it open directly without this winow appearing.
8
6145
by: jolakammu | last post by:
Guys, I am calling onclick="document.form.submit();" in a hyper clink. On click, it goes to a fuseaction where act_load_structure.cfm loads the structure with form variable. But the form fields are not avaibale in act_load_structure.cfm . It says form fields are not defined. Do you know why. I appreciate your help in advance
3
1809
Fary4u
by: Fary4u | last post by:
Hi is any body know how to create the hyper link with following code i can't do it ? <?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <pic> <image>img/1.jpg</image> <logo></logo> ? ? ? <WEBSITE>http://www.domæne.dk</WEBSITE> ? ? ? <details>Weeknights at 8pm</details>
0
9593
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
10088
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
9169
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
7633
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
6862
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
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
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.