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 is a Modem? Modems are fundamentally used to interface digital circuits to transmit information on analogue channels as telephone systems. Modem is from modulator-demodul
Specified the average case complexity of sequential search in an array of unsorted elements of size n if the following conditions hold: a) Probability of the key to be in the a
Problem: a) Most RMI and RPC systems expect to be supported by the "Request-Reply Protocol". Describe what "Request-Reply Protocol" is. b) Describe the invocation semantics
Real time clock A real-time clock keeps the time in real time - i.e. in hours and minutes. Software for the real-time clock comprises an interrupt service procedure which is c
Aim: Build a program or application which gives an interface to the user to maintain his personal account for E-mails & should be able to work on the following applications. Des
How can we send data to external programs? Using SPA/GPA parameters(SAP memory). Using EXPORT/IMPORT data (ABAP/4 memory)
Q. A. Which gates are called Universal Gates? Why? B. State and prove any one of the DeMorgen's Laws. Show that these theorems can be extended up to any number of variables.
This project is aimed at developing a web-based and central recruitment Process system. this web site is for Fresher candidates who graduated. Some features of this system will be
State the Encryption and decryption process with example Encryption and decryption process in the Figure where Ram wants to send a confidential message to his friend Shyam. Ram
Write an HTML program segment that contains hypertext links from one document to another . HTML permits any item to be placed as a hypertext reference. Therefore a single word
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