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.
A stationary random displacement signal was digitised at 64 samples a second and analysed to obtain an auto-spectral density. The signal was calibrated in mm units. The frame siz
Describe Real and protected mode: Operation of Real mode interrupt: When microprocessor completes executing the current instruction, it concludes whether an interrupt is act
What is Open Database Connectivity (ODBC) It happens that in addition to conventional or most popular database management systems, many companies go for proprietary software c
This is a small window that is demanding your attention. You must respond before you can carry on using the program that shown the dialog box. A dialog box does not have a minimize
Raises when accessing an unassigned memory location accessing a null pointer
Existential Introduction: Now if we have any sentence as, A, and variable, v, that does not occur in A, so then for any ground term, g, such occurs in A, than we can turn A in
Q. Explain the Fetch Cycle? The beginning of every instruction cycle is the fetch cycle and causes an instruction tobe fetched from memory. The fetch cycle comprises four
Explain in brief about the broadband It isn't just computers which can be linked without wires, different peripheral devices can be linked to a computer system without the need
Q. Describe about general-purpose registers? The general-purpose registers as the name proposes can be used for several functions. For illustration they may comprise operands o
What is an I/O buffer? I/O buffer: One type of input-output requirement arises from devices which have a very high character density as disks and tapes. With these chara
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