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.
JMX is native to the Java programming language. As a result, it offers natural, efficient, and lightweight management extensions to Java-based functions. It has of a set of specifi
Calculating Block Size: B A unit of associatively -one tag for B A words B T unit of transfer-B T words to/from primary memory as a unit One valid bit for
applications of context free grammar
Explain the Reference Count The system relates a reference count along with each memory area to point out the number of its active users. This number is incremented while a us
What is interactive reporting? A classical non-interactive report having of one program that makes a single list. Instead of one extensive and detailed list, with interactive
In a DTMF phone, digits are represented by: (A) Orthogonal frequencies. (B) Orthogonal Phases. (C) Orthogonal codes. (D) Orthogonal pulses. Ans: Di
Explain difference between Dynamic and static binding. Dynamic and static binding: Dynamic binding is a binding performed after the execution of a program has immediately beg
Hello there i have 4 exams of ICT and i am after a tutor who can help me in those 4 subjects. One hour for each subjects will be good for me as i have sample papers ready for all s
Q. Show the Features of parallel virtual machine? Easy to install; Easy to configure; Multiple users each can use PVM concurrently; Multiple applications fro
Determine the types of software There are two types of software today: Application and systems. Meaning of the two changes computer to computer. As we concentrate on large c
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