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 working of Digital Versatile Disk? With the capacious digital versatile disk (DVD) electronics industry has ultimately found an acceptable replacement for videotape
OLAP is called as online analytical processing which gives answers to queries which are multi dimensional in nature. It composes relational reporting and data mining for giving sol
What is an operating system? An operating system is system software which provides interface between hardware and user. The operating system gives the means for the proper uti
Define congestion and grade of service. Congestion : This is uneconomic to give sufficient equipment to carry all the traffic which could possibly be offered to a telec
Design a game application that plays the children's game of rock, paper, scissors. The user enters a letter indicating a choice. The Math.random method is then used to pick a value
In a two stage network there are 512 inlets and outlets, r=s=24. If the probability that a given inlet is active is 0.8, calculate: Blocking probability Given: N =M =512,
E xplain the working of thousand line exchanges by u sing a combination of uniselectors and two motion selectors. The schematic diagram for such an exchange is demonstrated i
What is disk controller The electronic circuit that controls the operation of the disk known as disk controller. word count The number of words in the block to be tran
How speech is transmitted in a digital switching environment using PCM/TDM? A digital carrier system is a communications system which uses digital pulses quite than analogue si
What do you understand by Electronic Funds Transfer? Electronic Funds Transfer: It's an electronic payment method that transfers the money value from one bank account 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