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 does the term convergence mean regarding E-commerce? Convergence regarding e-commerce: The capability to leverage and integrate the different data sources and proces
No C don't have circular shift operator. (Part of the reason why that is the sizes of C's types aren't precisely described----but a circular shift makes most sense when applied to
Determine the function of Dynamic model Dynamic model: Dynamic model describes how system responds to external events. The implementation of the control flow in a program must
Normal 0 false false false EN-US X-NONE X-NONE
These five questions are part of the assignment. The answers of each question can be written in around 300 words (with relevant diagrams and Refrences). Assignement should be comnp
Q. Describe about Physical Systems? Physical Systems are tangible entities which may be dynamic or static. Computer Systems, Buildings,Vehicles etc. are illustrations of p
Q. Explain FORM and INPUT Tag? A good way to learn about forms is to make use your notepad editor and make a new HTML document. Save it as form1.htm in some folder somewhere. Y
Define main memory and auxiliary memory? The memory unit that communicates directly with the cpu is known as main memory [RAM].Devices that give backup storage are known as aux
What is micro programmed control? Micro programmed control is a scheme in which control signals are formed by a program same to machine language program.
Explain at least one modulation technique used for high speed modems. FSK - Frequency Shift Keying: In such technique the frequency of the carrier signal is changed as per to
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