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.
The A/D converter whose conversion time is independent of the number of bits is ? Ans. Parallel conversion is the A/D converter whose conversion time is independent of the Numbe
Combinational/Sequential Logic design with Integrated Circuits (Dual in line package) Car wash concept with the following steps in a Combinational Logic Diagram: 1. Start
What are the main data structures used in the following areas: RDBMS, Network data model and Hierarchical data model? RDBMS = Array (i.e. Array of structures) Network data m
Explain UDP (User Datagram Protocol). UDP utilizes a connectionless communication paradigm. It is an application of using UDP doesn't require preestablishing a connection befor
What is spatial parallelism
Differentiate concurrent and parallel executions ? The words "parallel "and "concurrent" are often used interchangeably, however they are different. Parallel execution is connec
Some famous projects on cluster computing are as follows: High Net Worth Project: (developed by: Bill McMillan, JISC NTI/65 - The HNW Project, University of Glasgow, The prim
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. Explain Shift register with diagram and waveform. Q. Write a short note on Decoder.
Define Programmed I/O. It is the result of input and output instructions written in the computer program. Every data item transfer is initiated by an instruction in the program
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