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.
pebble merchant
Q. Show the layout of Dvorak-Dealey keyboard? This was one keyboard layout designed to be a challenger to QWERTY layout. This was designed by August Dvorak and William Dealey a
Efficiency of Vector Processing over Scalar Processing: We know that, a sequential computer processes scalar operands one at a time. Thus, if we have to process a vector of len
Mention the various IC logic families. Ans. Different IC Logic Families: Digital IC's are fabricated through employing either the Unipolar or the Bipolar Technologies and are te
Q. What is External Modems? External Modems: Modems externally associated to PC via a parallel or serial port and into a telephone line at the other end. They can generally co
Proof by Contradiction: Now for forward chaining and backward chaining both have drawbacks. But another approach is to think about proving theorems by contradiction. So we can
Describe the term- Systems Analysis A systems analysis team is every so often brought in to improve on an existing system. Often this involves moving from a paper-based filing
In order to support IA-32, the Itanium can switch into 32-bit mode with special jump escape instructions. The IA-32 instructions have been mapped to the Itanium's functional units.
Public Key Infrastructure solutions The use of public-key based security systems requires great attention and due care in design and management of security features. The secur
Elaborate protected mode memory addressing in brief. Protected mode interrupt: In protected mode, interrupts have exactly the same assignments as in real mode though int
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