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.
A CGI bin directory is a special directory on the server where CGI scripts are allowed to be implemented. Most servers are configured to only permit CGI scripts to be implemented f
When an input signal A=11001 is applied to a NOT gate serially, its output signal is ? Ans. First input applied will be LSB 00110, as A=11001 is serially applied to a NOT gate
Q. System Development and Data Administration? System Development: In traditional business systems analysts and programmers are organized into permanent teams which support i
When transferring one function to another, what is meant by the guest function? A pointer to a function can be passed to another function as an argument. This allows
Q. Sequential Execution of Instructions in RISC? Let's describe pipelining in RISC with an illustration program execution sample. Take the given program (R denotes register).
How different are interface and abstract class in .Net? Abstract classes cannot be instantiated it can have or can't have abstract method basically known as must inherit as th
Units of artificial neural networks: However the input units simply output the value that was input to them from the example to be propagated. So every other unit in a network
Illustrate functional diagram of digital multiplexer . Write the scheme of a 4- input multiplexer using basic gates (AND/OR/NOT) and explain its operation. Ans: Multiple
Assignment 3: Naïve Bayes algorithm for text classification. First part: In this assignment, we will redo the task of classifying documents (assignment 2) using the same R
Differentiate between Transport and Session layers of OSI model. OSI Model Transport Layer The transport layer utilizes the services provided through the network layer, as
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