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.
Q. Explain the Memory Transfer process? Memory Transfer Transfer of information from memory to outside world which implies I/O Interface is known as a read operation. Tra
Determine about the Security methods Security methods also protect information from accidental or intentional modification, manipulation or destruction. Most security experts o
What is the logical difference among Move A TO B and COMPUTE B = A ? Ans) In case of Move A TO B it will move whatever the value of a in to b. It mean it will move nume
Problem 1 (a) What is the difference between an MPI blocking send function and an MPI non-blocking send function? (b) What is a communicator in MPI? (c) Name correctly
What is the main problem with segmentation? Problem with segmentation (i) Is with paging, such mapping needs two memory references per logical address that slows down the
Find the minimum SOP and POS expression for the following functions using Karnaugh Map and realize the expression using appropriate gates. Also realize SOP form using NAND-to-NAND
"George has a dog called Ernie, which is a trained Labrador. Trained Labradors and poodles are obedient, and all obedient dogs are good dogs. All good dogs that have a master will
What are the risks by merchant's perspective in Electronic Payment Systems? Through merchant's perspective: • Copied or Forged payment instruments • Insufficient funds in
Define about signal and component of obejct oriented modeling A signal is a specification of an asynchronous stimulus communicated among instances. A component is a physical
As an XML expert you are needed to model a system for an online furniture shop. After an interview with the shop manager you have the certain information: The detail of th
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