views:

126

answers:

2

I have seen new computers having two processors on same motherboard . How can two processors on same motherboard function properly because it will be something like two brains (trying) to control one body, How actually they carry out parallel processing, is it actually does it ?

+2  A: 

There are rules which decide who wins if the two (or more) CPUs/cores want to access the same resource. Usually, one CPU will try to access it later, so it will have to wait. If two CPUs actually want to access the same resource at the exact same time, then the rules will make sure that one wins. Today, the rules have become quite complex to make sure that one CPU can't hog a resource (draining the other one).

Caching is a very complex part of this; every CPU will copy part of the real RAM into its caches. That means if CPU 1 has the address X in its cache and the CPU 2 reads or writes that address, then interesting things can happen. Technologies to solve this are address sniffing (CPU 1 notices which addresses CPU 2 wants to see and sends a signal to tell it that the content of this address isn't valid right now), segmentation of RAM (the CPUs can't actually see most of the RAM, so there are only small overlaps where this problem can actually happen), or a special cache bus where the caches of the CPUs talk to each other ("I just read this address", "I'm writing X into that address").

It's a very complex area and it gets more complex with every day. As far as we can tell, this is the only way to keep Moore's Law up for a few more years.

For more details, see the Wikipedia article.

Aaron Digulla

related questions