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.
Environments: We have seen that an agents intelligent should take into account certain information when it choose a rational action, including information from its sensors, in
Determine the types of software There are two types of software today: Application and systems. Meaning of the two changes computer to computer. As we concentrate on large c
A device that forwards data packet from one network to another is known as a Switch device.
What do you mean by u-area (user area) or u-block? This having the private data that is manipulated only by the Kernel. This is local to the Process, i.e. every process is a
Describe Data Parallel Model? In data parallel model most of parallel work concentrates on performing operations on a data set. Data set is characteristically organised in a co
What are the disadvantages of Bespoke Software - Very dependent on suppliers of the software; if they go out of business there would be little or no support if problems occ
Explain Tabulation Method for simplifying k maps? The Tabulation Method (QUINE-McCLUSKEY MINIMIZATION) An expression is represented in the canonical SOP form if not
Determine about the raster-scan systems Most of the present raster-scan systems contain a separate processor called as display processor. This processor performs graphics func
Q. Instruction of a micro-program? A micro-instruction is an instruction of a micro-program. It specifies one or more than one micro-operations that can be executed concurrentl
2. Explain any ten CASE tools
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