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.
What are the two ways of constructing a larger module to mount flash chips on a small card? The two ways are:- a) Flash cards b) Flash drivers.
Obstacles to IS implementation While information systems are now becoming the norm in most organisations the journey to this point has been a difficult one. Even in the 21st c
Q. Give the difference between Register and Counter. Q. Give the difference between Flip-flop and Latch. Q. Draw a set of waveforms for following signal on out-put line.
Q. Show the Responsibilities of session layer? Session layer: Main functions of this layer are to establish, synchronize and maintain the interaction between two communicatio
a. Explain the meaning of frame buffer? Draw a block diagram showing the method for scanning out an image from frame buffer to display surface. b. Explain the structure of plasm
The XOR gate. The exclusive OR or XOR gate is similar to a two input OR gate. The output of an XOR gate is logic 1 only when one input or the other input is high and is 0 when
Minimax algorithm - artificial intelligence: The minimax algorithm is so called because it assumes that you and your opponent are going to act rationally, so that if you will
A computer system provides protection using the Bell-LaPadula policy. How would a virus spread if A) the virus were placed on the system at system low (the compartment that all o
Classification Of Parallel Computers Introduction Parallel computers are those that underline the parallel processing among the operations in some way. In the last unit,
to develop an adaptive concept map providing personalized learning for Operating System subject with text file(in any form like html,ppt,txt,doc,pdf)as input
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