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.
If the throughput scales upward as time progresses and the number of Vusers enhance, this showing that the bandwidth is sufficient. If the graph were to remain relatively flat as t
Q. Explain Bus Interface Unit? BIU (Bus Interface Unit) mainly interacts with system bus. It executes nearly all the activities relating to fetch cycle like: Computing
What happens if only one of the commands SET SCREEN and LEAVE SCREEN is used without using the other? If we use SET SCREEN without LEAVE SCREEN, the program ends processing for
Q. Drawback of indirect addressing? • Drawback of this scheme is that it needs two memory references to fetch actual operand. First memory reference is to fetch the actual addr
Unit testing and integration testing: Unit testing focuses on the least element of software design by the module. Unit test is conducted on every of the modules to uncover er
Find the Boolean expression for logic circuit shown in Figure below and reduce it using Boolean algebra. Ans. Y = (AB)' + (A' + B)' = A' + B' + AB' by using Demorgan's Theorem. =
Firewalls While getting one firewall for the company's Intranet it should be well known that firewalls come in both hardware and software forms, and that even though all firew
Explain new services of CPU Based Exchange. These new services are termed as supplementary services and several of the prominent ones are given below as: Category 1:
Highlights of the RMTrack application: ? Web based access permits your users to access the database from anywhere. ? Available as a hosted solution or a download for local in
Q. Write a program to find 1's and 2's complement of a Binary number. Perform necessary checking that if entered number is not a valid number, ask user to enter valid Binary n
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