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.
The Signalling connection control part (SCCP) and message transfer part (MTP) together are referred to as (A) Signal Switching Points (SSPs) (B) Signal Transfer Points
An array is referencing using a base array value as well as an index. To simplify addressing in arrays 8086 has provided two index registers for mathematical computations viz. BP a
Classify Process, differentiate program, process A process maybe concerned to be a program being run. A program isn't a process of itself; it's a passive Entity while the proce
E ngaged tone is generated in the: (A) Telephone instrument of calling subscriber (B) Telephone instrument of called subscriber (C) Exchange (D) Repeater
Explain Bottom up parsing. Bottom up parsing: This parse attempts to increase syntax tree for an input string by a sequence of reduction. If the input string can be decreas
Why a function should have at least one input? There is no strong reason for this in verilog. I think this restriction isn't removed fin SystemVerilog. Some requirements where
Q. How can we use Ordered Lists? Lists having numbered items are termed as ordered lists. They are used when items in the list have a natural order. They can also be used when
Would you like to easily automate your MS Access database through menu driven selections? This can be accomplished by producing a form with customized buttons that point to macr
how to rotate shift right
In a subscriber loop that contains a series resistance of 300 ohms to protect the batteries in the exchange, a normalized telephone draws 10 mA and its standard input d.c. resistan
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