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.
What are the steps to design algorithm? Formulate algorithm for each operation. Analysis specification tells what the operation does. The algorithm shows how it is done. The st
Q. Instruction Issue degree in superscalar processing? The major concept in superscalar processing is how many instructions we are able to issue per cycle. If we are able to is
Computer Architecture Basics: Some of computer architecture at companies such like AMD and Intel uses more fine distinctions: Macro architecture- this is an architectura
? Nodes: A node shows any hardware component. The configuration of hardware is shown by attributes of nodes. ? Components: A component shows software. Every component straight
Q. How to Changing the Directory in DOS? You can change the directory. After changing the directory, the new directory becomes the default directory. For example, you change th
Q. Design an OR to AND gates combinational network for the following Boolean expression: ABCD + A'BC'D + A'BC'D' + A'BCD + (A'B'C'D' + AB'CD) Two terms in parenthesis are Don
Eequivalences rules: This conveys a meaning that is actually much simpler so than you would think on first inspection. Hence we can justify this, by using the following ch
Generally the register storage is faster than cache andmain memory. Also register addressing uses much shorter addresses than addresses for cache and main memory. Though the number
Multiple bus architecture: One solution to the bandwidth restriction of a single bus is to simply add extra buses. Consider the architecture indicated in given figure that con
Paged virtual memory: Mostly all implementations of virtual memory divide the virtual address space of an application program into pages; a page is a block that contains conti
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