Data Depend
Data Depend
Data Depend
• S1
S2 S4
S3 I/O
S1 S3
Control Dependence
• This refers to the situation where the order of the
execution of statements cannot be determined
before run time.
• For example all conditional statement(IF), where
the flow of statement depends on the output of the
condition.
• Different paths taken after a conditional branch
may depend on the data hence we need to
eliminate this data dependence among the
instructions.
• This dependence also exists between operations
performed in successive iterations of looping procedure.
• Control dependence often prohibits parallelism from
being exploited.
• Dependence may also exist between operations
performed in successive iterations of a looping
procedure.
• Control-independent example:
for (i=0;i<n;i++)
{
a[i] = c[i];
if (a[i] < 0)
a[i] = 1; }
• Control-dependent example:
for (i=1;i<n ; i++)
{
if (a[i-1] == 0)
a[i] = 0;
}
Resource dependence
• Resource dependence is concerned with conflicts
in using shared resources, such as registers, integer
units and floating point units and memory areas,
etc among parallel events.
• When conflicting resource is ALU ,ALU
Dependence.
• Memory (storage) conflicts are called storage
dependence
• Violation of any one or more of the 3n(n-1)/2
Bernstein’s condition prohibits parallelism.
n = number of processes.
Software Parallelism
• The average software parallelism takes
8/3 =2.67 instructions /cycle
• Here Avg. hardware parallelism displays
8/7=1.14 instructions/cycle.