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.
What are the different methods used for handling the situation when multiple interrupts occurs? 1) Vectores interrupts 2) Interrupt nesting 3) Simultaneous Requests.
POSIX is the IEEE's Portable Operating System Interface for Computer Environments. The standard provides compliances criteria for operating system services and is designed to allow
Design a circuit for determining the 9's compliment of a BCD number by using 4-bit binary adder and some external logic gates? Compliment of a BCD number 9's co
Explain Lexical substitution during macro expansion ? Lexical substitution is used to produce an assembly statement from a model statement. Model statements have 3 kinds of str
Nonvolatile Read Write Memory, also kown as Flash memory. It is also called as shadow RAM.
State about the Object oriented analysis design Object oriented analysis design (OOAD) is a bottom up approach which supports viewing system as a set of components (objects) w
Explain routing tone in strowger telephony with waveforms and the timings. The call-in-progress tone or routing tone is a 400 Hz or 800 Hz intermittent pattern. In electromec
In a frame transmission, CRC stands for? CRC stands for Cyclic Redundancy Check, in a frame transmission.
Q. Convert the following from octal to binary, decimal, hexadecimal and BCD. a) 7.7 b) 4037 c) 23.34
How does bus arbitration typically work? i. A bus master waiting to use the bus asserts by the bus request. ii. A bus master cannot be the bus until it's request is grant
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