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.
Often calculating all the data is not possible by aggregations for this reason some of the difficult data problems are solved. In order to verify which data should be solved and me
Q. Explain working of DotMatrix or InkJet Printers? Three major issues consider the quality of characters generated by DotMatrix/InkJet Printers: - Number of dots in the matrix
What is the most common biometrics? The most common biometrics is the given below: Face geometry (Photo): In this the computer takes the picture of your face and matches t
Sort the following list using selection sort technique, displaying each step. 20,12,25,6,10,15,13
What is the fundamental Digital Design? Digital design is distinct through analog design. In analog circuits we deal along with physical signals that are continuous in amplitud
Optical resolution or hardware resolution is mechanical limit on resolution of Scanner. For scanning the sensor has to advance after every line it scans. Smallness of this advancem
How is a Microsoft CRM Workflow tool enabled? A Microsoft CRM Workflow tool enables certainly one to as given below: • Explain business policies based upon established proce
Describe about the Digital cameras The microprocessor would be used to control the below functions, for instance: - shutter speed - lens focus - Flash - Aperture (l
These five questions are part of the assignment. The answers of each question can be written in around 300 words (with relevant diagrams and Refrences). Assignement should be comnp
Give explanation about the use of SSL to secure the network. SS L stands for Secure Sockets Layer is a protocol developed through Netscape for transmitting private document
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