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.
Explain Disadvantage of Optimal Page Replacement Algorithm Optimal page replacement algorithm cannot be implemented in the general purpose operating system as it is impossible
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
Explain the characteristics of program interpretation model. The program interpretation model characteristics are: The source program is retained into the source form it
Instruction buffers For taking the complete advantage of pipelining pipelines must be filled continuously. So instruction fetch rate must be matched with pipeline consumption r
How many words can be acquired by arranging the letters of the word 'UNIVERSAL' in different way? In how many of them (i) E, R, S takes place together (ii) No two of the
Explain about Flip-Flops Flip-Flops are also called bistable multivibrator. A flip-flop is capable of storing 1 bit of binary data. It has two stable states- 'one' and 'zero
Explain the architecture of SS7 . A block schematic diagram of the CCITT no. 7 signaling system is demonstrated in figure. Signal messages are passed by the central proces
Advantages of random scan display Early computer displays: basically an oscilloscope. Control X, Y with vertical/horizontal plate voltage. Often used intensity as
Q. Describe the LISTS used in html? Lists are used when data are to be mentioned in form of points such as: causes of a particular issue, list of items etc. Lists break up mono
Explain the PDCA cycle. PDCA is a four step problem solving method. The following are the description of each step: 1. P - Plan (Devise your Plan). Identify an opportunity a
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