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.
i want the matlab code for the following events 1. face detection 2. video to frame conversion 3.video shot boundary detection
Busy hour traffic is the (A) maximum average simultaneous traffic. (B) traffic during peak hour. (C) traffic when all subscribers are engaged. (D) the durat
The following definition of mapping is adapted from the first edition of the Set Book: Mapping concerns the relationship between controls and their effects in the world. Nearly al
Q. What is Domain explain? Domain can be an apartment complex, a town or even a country. Sub-domains can correspond to organizations like expertsmind. United States comes under
Problem 1 (a) Identify and briefly describe the possible roles of Codes of Ethics (b) Describe why is a code of ethics important to stakeholders. (c) Explain how should
what is physical data structure in internals of rdbms?
Direct Mapping: In this particular technique, block j of the primary memory maps onto block j modulo 128 of the cache. The primary memory blocks 0,128,256,...is loaded
Q. Define Decision Support System? Ans. The decision support system is an information system application which help decision making. DSS tends to be used in planning or analy
Q. Main drawbacks of CD-ROMs? The main drawbacks of CD-ROMs are: It is read only thus can't be updated Access time is longer than that of magnetic disks. Very
Use 4 D-bascules connected in serial all synchronized with the similar CLK. Then connect all 4 outputs, & 2nd output must reverse, of the D-bascule to an AND logic. The output of t
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