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.
Parallel Overhead The amount of time needed to organize parallel tasks, as opposed to undertaking useful work. Parallel overhead may comprise factors like: 1) Task start-u
What are the basic components of dialog program? Screens (Dynpros) Every dialog in an SAP system is controlled by dynpros. A dynpros having of a screen And its flow log
The "SKIP TO LINE line number" is dependent on which statement included in the report statement of the program. The "SKIP TO LINE line number" is dependent on "LINE-COUNT" stat
Differentiate between Batch Operating System and Time Sharing Operating System? Batch operating systems : A batch is a sequence of jobs. Such batch is submitted to batch proce
Q. Explain about CD-ROM and DVD-ROM? Optical disks employ Laser Disk Technology that is the latest and most promising technology for high capacity secondary storage. Advent of
As per the JMS specification, when you are in a transaction, the acknowledge Mode is ignored. If acknowledge() is known as within a transaction, it is ignored.
For each of the following variables: YEARofBIRTH transformed into a new variable called . To do this you will need to use the Command. Hint codes 9998 and 9999 are missin
1. How can you divide the screen into quadrants? Is the process called as ‘viewing transformations’?
Explain the importance of Object Oriented Modelling It is important to note that wi t h the growing complexity of systems, significance of modelling techniques increases. Beca
1. The Goal: Do you think that this is an operational methodology or a philosophy? Please explain. 2. How to apply Constraint Management to a Production Facility? How about to 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