What's new

Dual Processors?? (1 Viewer)

Steven K

Supporting Actor
Joined
Jan 10, 2000
Messages
830
Applications have to be written to make efficient use of Dual-Processor setup. A single thread can only run on a single processor... therefore, single-threaded applications (of which there are many) will see no improvement in a dual-processor setup.
Something else that people dont keep in mind is that most applications do cause a bottleneck in multiple CPU-based systems. This is because with all modern Operating Systems that support multiple OS support (Win NT, 2K, XP), the operating system only maintains ONE heap for itself.
For those non-technologically inclided folks, the heap is that space that applications and the OS use to maintain dynamic memory allocation, etc...
Applications use the heap when they dynamically allocate memory (can also be allocated on the stack, but its not dynamic). Applications have their own default heap space; however, most applications allocate their memory on the default heap. If you have ever programmed in CC++, if you have used the function malloc or the operator new then you have allocated memory on the default heap. You can allocate memory on the applications heap (using heapAlloc()) but programmers rarely do this.
Anyway, no matter how many CPUs you have, if your default heap bottlenecks, it's all in vain. Applications which make use of multiple threads, and use their own heap space, will run the most efficiently in a multiple CPU environment, but many programs are not coded in this way. (I admit, its much easier and more convenient to just use the default heap, and I often times do this).
So, until programmers start coding differently than they are now, or until OSes start to have a default heap for each processor, instead of just one for the entire OS, multiple CPU usage will not be what it could be.
 

John_Berger

Senior HTF Member
Joined
Nov 1, 2001
Messages
2,489
This is because with all modern Operating Systems that support multiple OS support (Win NT, 2K, XP), the operating system only maintains ONE heap for itself.
All modern Windows-based operating systems, you mean. UNIX has been kicking a$$ with multiprocessing since Windows was still in its 3.11 stage. :D :D :D
 

Steven K

Supporting Actor
Joined
Jan 10, 2000
Messages
830
John,

I believe that Unix also uses one default Operating System heap... it just so happens that pthreads have been around for ages, so Unix programmers have become accostomed to programming in a true multi-threaded environment. Even though multi-threading first appeared in Windows (NT, not sure which version) most programmers haven't been making effective use of them until fairly recently. Even before multithreading came around, Unix programmers had fork() to play around with (although you dont see as much multi-processing in this way as much as you used to)... I think a large reason why is that fork() has several issues...

I still use fork() occasionally, but pretty much just stick with pthreads now... recently I have been using ACE alot. It's basically a platform-independent library (completely open source, woohoo!) of threading functions, etc...
 

Users who are viewing this thread

Sign up for our newsletter

and receive essential news, curated deals, and much more







You will only receive emails from us. We will never sell or distribute your email address to third party companies at any time.

Forum statistics

Threads
357,052
Messages
5,129,652
Members
144,285
Latest member
acinstallation715
Recent bookmarks
0
Top