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 High performance of Instruction execution? High performance of Instruction execution: While mapping of HLL to machine instruction the compiler favours relatively sim
A header in CGI script can specify? A header into CGI script can give format of document and New location of perticular the document.
It is not essential to maintain the Parent-Child relationship among the tables in Logical Database Structure. False. One has to handle the Parent-Child relationship.
Explain in brief about Compact disks (CD) These are an optical storage media that have basically taken over from floppy disk. Software is now generally supplied on a CD (in for
Q. Limitation identified in Amdahls law? There is one main limitation identified in Amdahl's law. As said by Amdahl's law workload or problem size is forever fixed as well as n
Q. Observations of High Level Language Program? Observations Integer constants appeared nearly as frequently as structures or arrays. Most of the scalars were foun
Q. Hardware required for superscalar processing? For applying superscalar processing a number of special hardware should be offered that is discussed below: • The necessity
Explain the term- Wireless Technologyand Broadband Wireless Technology (WiFi) and Broadband Most areas in the world now provide broadband instead of dial up for connectin
What are the Input for UML development UML is an attempt to standardize artefacts of analysis and design consisting of semantic models, diagrams and syntactic notations. The fi
First Generation Electronic Computers (1937-1953) Three machines have been promoted at different times as first electronic computers. These machines used electronic switches
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