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.
Q. Explain Segment Registers in bus interface unit? These are very significant registers of CPU. Why? We will answer this later. In 8086 microprocessor memory is a byte organiz
Introduction Our research methodology requires gathering relevant data from the specified documents in order to analyze the material and arrive at more complete understanding
Define interrupt and ISR? An interrupt is a request from an I/O device for service by the processor. The processor gives the requested service by implementing the interrupt ser
Build data Flow diagrams showing functional dependencies Data flow diagrams are very useful for showing functional dependencies. In data flow diagrams processes are indicated
Designed, developed, tested and documented the demo created for NPBlox framework. NPBlox framework is a framework which enabled developers to create CLI/WEB/SNMP interfaces for
Sixth Generation (1990 - ) This generation begun with many gains in parallel computing, both in hardware area and in improved understanding of how to build up algori
Q. Explain about Deadlock Avoidance? To prevent deadlocks two kinds of techniques are used: 1) Static prevention: It employs P and V operators in addition to Semaphores to
Variables and Quantifiers: Now we have to diagnose now that if we wanted to say that there is a meal at the Red Lion which costs only 3 pounds, is well sayed. Rather thenif we
State the Relative addressing The location of data is specified relative to current value of the program counter. This is helpful for specifying location of data which is given
how to write this program,what are the declaration and function are needed in java program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : pack
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