Sei sulla pagina 1di 2

How Parallel

Processing Works
A
s odd as it may seem, adding a second processor
doesnt double a systems
performance. The reason is that
collaboration always complicates
the workflow, especially when
trying to get two or more processors to work together. One
example of the overhead required to coordinate multiple
processors is the way the system

Processor A

Processor B

Both processors begin by sharing data regarding the value


of a variable (X=12).

Processor A

deals with cache coherency, or


ensuring that all processors use
the most up-to-date data. Since
each processor has its own local
memory known as cache, its
possible for information to
change in one processor but
remain unchanged in the cache
of the other processor. If a portion of the program expecting
the new information is executed

Processor A

Processor B

Processor A runs a function that changes the value of X to


10. Since Processor B did not execute the same function, the
value for X remains equal to 12. If Processor B attempts to use
this value for X, it could cause problems within the application.

Processor A

Processor B

Processor B requests a value for X, and Processor A overhears the request.

on a processor with the old


information in cache, the result
could be a serious application
failure. To address this problem,
most processors will snoop on
their neighbors or listen to the
request they make. Although the
following example assumes a
system with two processors, the
same idea holds for systems
with four or more processors.

Processor B

Processor A interrupts what Processor B is doing to inform


it that it has assigned a new value to X. It then updates the
value for Processor B.

Cache
Processors use their own local memory to store frequently accessed information. L1, or level 1, cache is
extremely fast memory, but has limited size (about
16KB). L2, or level 2, cache is a little slower but much
larger. Most desktop systems have about 256KB of L2
cache while high-end processors for Internet servers
can have as much as 2MB of L2 cache.

Memory
Controller

STOP
Update to
X=10

Processor A

Processor B

Processor A recognizes that the value of X is shared with


another processor, so it monitors requests made by
Processor B.

Processor A

Processor B

Updating RAM

Processor A

Processor B

Because the value of X changed in Processor A's


cache, the computer's memory may still have an
outdated value for X. In order to make sure that the
system's memory gets the most up-to-date value,
the memory controller snoops on any conversation
between the processors. If it overhears Processor A
telling Processor B to update its value for X, it will
make the same changes in memory.

With the value updated appropriately, Processor B continues its work.


Compiled by Chad Denton

Graphics & Design by Lori Garris

Potrebbero piacerti anche