Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Show the Programmes for Parallel Systems?
Adding elements of an array using two processor
int sum, A[ n] ; //shared variables
void main ( ){
int i ;
for (i=0; i scanf ("%d",&A[i] ); sum=0; // now create process to be executed by processor P1 fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to - 1.sum is output variable // now create process to be executed by processor P0 add (A,0,n/2-1, sum); join 1 ; printf ("%d", sum); } add (int A[ ], int lower, int upper, int sum) { int sum1=0, i; for (i=lower; i<=upper; i++) sum1=sum1+A[i]; lock sum; sum=sum+sum1; unlock sum ; } In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
scanf ("%d",&A[i] );
sum=0;
// now create process to be executed by processor P1
fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to -
1.sum is output variable // now create process to be executed by processor
P0 add (A,0,n/2-1,
sum);
join 1 ;
printf ("%d", sum);
}
add (int A[ ], int lower, int upper, int sum)
{
int sum1=0, i;
for (i=lower; i<=upper; i++)
sum1=sum1+A[i];
lock sum;
sum=sum+sum1;
unlock sum ;
In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
Orbix is a CORBA ORB (Object Resource Broker) - a commercial software product which helps programmers builds distributed applications. Orbix is an execution of the OMG's (Object Ma
What are the features of PROM? They are programmed directly by the user. Faster Less expensive More Flexible
Can we include customizing include or an append structure with Pooled or Cluster tables? No.
Clear operation The clear operation compares words present in A and B and produces an all 0's result if two numbers are equal. This operation is achieved by the exclusive-OR mi
What are advantages and drawbacks of latches? Advantages and drawbacks of latches: Area of a latch is classically less than a Flip Flop. It consumes less power, becaus
how can we bimpliment half substractor using nand gate
State the term in detail $strobe $strobe. This task is very similar to $display task except for a slight difference. If many other statements are executed in same time unit as
Prolog Programming Language : Probably programming languages are procedural: than the programmer specifies exactly the right instructions (algorithms) required to get an agent
To how many tables can an append structure be assigned. One table can be assigned to append structure.
Explain bit pair recoding with an example? Ans: Bit pair recoding halves the maximum number of summands. Group the Booth-recoded multiplier bits in pairs and see the following
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd