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.
Using Module-Instance Parameter: Parameter values can be overridden while a module is instantiated. New parameter values are passed at the time of module instantiation. Top-
Jobs which are admitted to the system for processing is called ? Ans. Long-term scheduling is admitted to the system for processing.
What is a Demultiplexer ? Ans. Demultiplexer has similar circuit as decoder but here E is obtained as the particular input line, the output lines are similar as decode
What is Batch processing In this process, a number of tasks (or jobs) are all collected together over a set period of time. They are then all loaded into the computer system (i
Explain Wait for graph (WFG) with Resource request and allocation graph (RRAG). WFG with RRAG: A graph G = (V,E) is termed as bipartite if V can be decomposed in two
Demonstrate how a typical DMA controller can be interfaced to an 8086/8085 based maximum mode system. For 8088 in maximum mode: The RQ/GT0 and RQ/GT1 pins are used to is
Write a program to echo the string 'Hello' to the serial channel (SCI) using the protocol of baud rate 9600,8 bits , no parity and 1 stop bit Consider the baud register as show
Q. What is Gantt chart and Kiviat diagram? Gantt chart: Gantt chart explains numerous activities of every processor with respect to progress in time in busy -overhead - id
Explain Non-Folded network Non-Folded Network: In a switching network, every inlet/outlet connection may be utilized for inter exchange transmission. In this case, the .excha
Level of a node The root is at level zero and the level of the node is 1 more than the level of its parent
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