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.
Discuss the different techniques with which a file can be shared among different users. Several popular techniques with that a file can be shared among various users are: 1
Everything stored on a computer can be represented as a string of bits. However, different types of data (for example, characters and numbers) may be represented by the same string
When a robot scripts runs the output makes a test log. Test logs are managed now is the TestManager application. Rational now permits you to classify your logs into any type of for
Define Memory Latency? It is used to refer to the amount of time it takes to transfer a word of data to or from the memory.
What are the advantages of using XML over HTML? The root cause of the problem lies in HTML (Hyper Text Mark-up Language), the defacto standard for web publication. The main pr
Explain about Magnetic tape a) They are mostly used for keeping files of data b )It is one of the cheapest and slowest methods for storage
What are the advantages and disadvantages of packet switching over circuit switching? The comparison of packet switching and circuit switching demonstrating advantages and disa
Version 2.8 may bring a combined Transform tool (Scale, Rotate,Flip and Perspective), more use of Cairo for attractive ant aliased graphics and more usability improvements. We will
Perceptrons: However the weights in any ANN are usually just real numbers and the learning problem boils down to choosing the best value for each weight in the network. Becaus
A message is a string of bytes that has meaning to the applications that use it Message = Header(s) + Application Data A message having of a header and the attached applicat
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