useing the new P4 HT
i have a new PC, bought it 2 weeks ago. 128mb RADEON PRO, 512 DDR2 RAM, Creative soundblaster live sound card, but most importantly i also have that new hyper threaded P4. This means if u look under the hardware manager thingy in the control panel it says that i have 2x3GHz proccessors.
Basicly i was woundering if it would possible to make use of these "2" proccessors by making one handle the windows messages and the other one handle game functions in the message handler. My knowledge of OpenGL and DX APIs are currently limited to making tringles spin so i must appologize if this is an obviuos question.
and another thing. i downloaded "Tricks of the Windows Game Programming Gurus" by andrei lemoth (might be spelt wrong) from www.programmers-unlimited.com/books and in that book he talkes about some weird optimazation tricks in the first chapter. for example he written that if u want to make struct u should make them allocate a multiples of 4 amounts of bits or just adding variables which will not be used to make it 32 bits worth of memory. Surely its better to allocate 5 bits then 32 as this saves on memory!?
he also sayed that its better to make lots of simple functions that do little on there own then one big one. but doesnt that mean that there is simply more code and the proccesor will take longer to do its stuff as it has to switch between different functions instead of doing one big one!?
and also he sayed that global variables should be used as often as possible but every other book i read on C++, Teach Your Self C++ in 21 Days, Idiots Guide to C++, and Game Programming All in One, all said that global variables should be avoided at all costs for security so that unwanted changes of the variables are not made.
Is he right or is he just CRAZY
www.programmers-unlimited.com, try it, its not too bad.
quote:
Original post by spetnaz_
he also sayed that its better to make lots of simple functions that do little on there own then one big one. but doesnt that mean that there is simply more code and the proccesor will take longer to do its stuff as it has to switch between different functions instead of doing one big one!?
This makes the code more readable and allows you to reuse the code. The compiler will automatically make it into one big function in release mode if it thinks performance will be better
quote:
and also he sayed that global variables should be used as often as possible but every other book i read on C++, Teach Your Self C++ in 21 Days, Idiots Guide to C++, and Game Programming All in One, all said that global variables should be avoided at all costs for security so that unwanted changes of the variables are not made.
Is he right or is he just CRAZY
Global variables have their uses, but generally you should try to avoid them. Why? Consider global variable ''ImportantVariable''. function X() is called - there is nothing to stop the programmer from making changes to ImportantVariable.
LaMothe has a lot of ideas about micro-optimization, most of which are wrong. As soon as I started reading that sentence, I thought, "oh gods, what ''trick'' has LaMothe thought up this time?" Here''s a few corrections:
1. Most compilers will pad structures for you.
2. You''re right, each non-inline function call has overhead. For purposes of organization, however, small functions tend to be better (as long as they represent logically encapsulated functionality).
3. Global variables are okay, as long as you realize why they can be a bad idea at times. (Every Other Book You Read On C++ will have a good discussion of this.)
How appropriate. You fight like a cow.
1. Most compilers will pad structures for you.
2. You''re right, each non-inline function call has overhead. For purposes of organization, however, small functions tend to be better (as long as they represent logically encapsulated functionality).
3. Global variables are okay, as long as you realize why they can be a bad idea at times. (Every Other Book You Read On C++ will have a good discussion of this.)
How appropriate. You fight like a cow.
thanx on that. Bytheway what is EXACTLY optimization is it just making the code smaller and making the .exe use up as little memory as possible
and what about the P4 HT question.
and what about the P4 HT question.
www.programmers-unlimited.com, try it, its not too bad.
[OT!!] Off topic: Sneftel, is your sign from monkey island?? [/OT]
There aren''''t problems that can''''t be solved with a gun...
There aren''''t problems that can''''t be solved with a gun...
There aren''t problems that can''t be solved with a gun...
By a weird co-incidence I just picked up my new computer with a P4 with HT, and then I see this topic 
Anyway, about HT as far as I understand it: HT does NOT mean you actually have 2 processors in you''re computer. It also does not mean you have 2 processors in 1 chip. HT is a technology which makes it possible for the computer to do tiny little tasks seperatly. More important: it makes the processor wait less. Also it is possible to take advantage from HT with code. I dont know how that actually works, but I''ve read that C++ compilers take or will take in the future advantage of HT.
I also have read that programs not optimized for HT have a performance gain between 0% and 20%.
Please note that I dont know much about HT yet, this is just what I have read here and there

Anyway, about HT as far as I understand it: HT does NOT mean you actually have 2 processors in you''re computer. It also does not mean you have 2 processors in 1 chip. HT is a technology which makes it possible for the computer to do tiny little tasks seperatly. More important: it makes the processor wait less. Also it is possible to take advantage from HT with code. I dont know how that actually works, but I''ve read that C++ compilers take or will take in the future advantage of HT.
I also have read that programs not optimized for HT have a performance gain between 0% and 20%.
Please note that I dont know much about HT yet, this is just what I have read here and there

Slurcko Durcko Duck!
but in the hardware manager thingy it clearly says i have 2 proccesors, so windows thinks that there are 2 proccesors. (boontje make sure you enabled HT at BIOS as by default it is not enabled)
So does anyone knowhow i could make my code take advantage of this technology, or is this forum too API oreintated, in which case does any one know where i could get some advise on this)
Just saw something on TV about the new G5, who in hell wants a MAC, they sack, they are expesive becuase they are all pritty inside (why? => so the technicians would be happy at the factory) and about 2 years behind x86 PCs. i mean all MAC lovers need a good wiping
So does anyone knowhow i could make my code take advantage of this technology, or is this forum too API oreintated, in which case does any one know where i could get some advise on this)
Just saw something on TV about the new G5, who in hell wants a MAC, they sack, they are expesive becuase they are all pritty inside (why? => so the technicians would be happy at the factory) and about 2 years behind x86 PCs. i mean all MAC lovers need a good wiping
www.programmers-unlimited.com, try it, its not too bad.
July 07, 2003 04:20 PM
but in the hardware manager thingy it clearly says i have 2 proccesors, so windows thinks that there are 2 proccesors.
(boontje make sure you enabled HT at BIOS as by default it is not enabled)
So does anyone know how i could make my code take advantage of this technology, (or is this forum too API oreintated, in which case does any one know where i could get some advise on this. no oofence but this is more of a harware thing thing then OpenGL or DX or MFC)
Just saw something on TV about the new G5, who in hell wants a MAC, they sack, they are expesive becuase they are all pritty inside (why? => so the technicians would be happy at the factory) and about 2 years behind x86 PCs. i mean all MAC lovers need a good wiping
(boontje make sure you enabled HT at BIOS as by default it is not enabled)
So does anyone know how i could make my code take advantage of this technology, (or is this forum too API oreintated, in which case does any one know where i could get some advise on this. no oofence but this is more of a harware thing thing then OpenGL or DX or MFC)
Just saw something on TV about the new G5, who in hell wants a MAC, they sack, they are expesive becuase they are all pritty inside (why? => so the technicians would be happy at the factory) and about 2 years behind x86 PCs. i mean all MAC lovers need a good wiping
I think HT is enabled by default or the computer shop did it for me. I see indeed 2 processors in my device list and in the task manager.
Also, a bit more about HT:
If you want to use HT, use threads. A bit of reading on intel.com:
"This technology is largely invisible to the platform. In fact, many applications are already multi-threaded and will automatically benefit from this technology. However, multi-threaded applications take full advantage of the increased performance that Hyper-Threading Technology has to offer, allowing users will see immediate performance gains when multitasking"
source: http://www.intel.com/technology/hyperthread/index.htm
So, the heavy stuff should be done in threads. This makes programming a bit more difficult, games will even be more complex I think.
Also, a bit more about HT:
If you want to use HT, use threads. A bit of reading on intel.com:
"This technology is largely invisible to the platform. In fact, many applications are already multi-threaded and will automatically benefit from this technology. However, multi-threaded applications take full advantage of the increased performance that Hyper-Threading Technology has to offer, allowing users will see immediate performance gains when multitasking"
source: http://www.intel.com/technology/hyperthread/index.htm
So, the heavy stuff should be done in threads. This makes programming a bit more difficult, games will even be more complex I think.
Slurcko Durcko Duck!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement