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.
Extranets can be also used to connect an intranet to Internet so that remote offsite access can be made in a company's intranet by an authorized individual. This can facilitate thr
Q. Explain about Parity bit? Parity bit is an error detection bit added to binary data such that it creates total number of 1's in the data either odd or even. For illustration
Question 1: (a) How would you explain human reasoning? (b) Explain the different types of human reasoning? Question 2: (a) What are the computational factors affec
What is port? What are the types of port available? An I/O interface having of circuitry needed to connect an I/O device to computer bus. One side consists of a data path with
Determine about the Information centres Airports, supermarkets and any application where information needs to be relayed to customers, gain advantage from having automatic inf
What is 1 00 line exchange with one two-motion selector per subscriber. Design: In, Strowger switching system is designed by using one two-motion selector for all subscrib
Q. Illustrate Memory Read operation? Memory unit receives the address from a register known as the memory address register designated by MAR. Data is transferred to another re
Minimisation using Boolean algebra is not always straight forward and sometimes it is not obvious if a further manipulation would give a simpler circuit. Karnaugh maps are a muc
Reprographic Methods i) Thermography ii) Dyeline jii) Microfiche iv) Fax In this unit you have learnt that: Used for Methods of reprography are used for the
Bespoke versus off-the-shelf software Generally software packages are bought off-the-shelf. Though, certain applications (generally for industrial companies, commercial busines
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