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 about the Public Key Cryptography. Public Key Cryptography: It is a cryptographic system which uses two keys as a public key identified to everyone and a private
We might model such a scenario using three types of object: one for Customers, one for BankAccounts and another for Transactions. In terms of data required, for Customers assume we
RISC Approach - computer architecture: The RISC processors only use easy instructions that can be executed within one clock cycle. therefore, the "MULT" command discussed abov
Flag is known as Low order register & Accumulator is known as High order Register.
Q. For function F(x,y,z) = ∑m (1,2,3,5,6) using TRUTH TABLE only 1. Find POS expression 2. Implement this simplified expression using two level OR-to-AND gate network 3. I
Give some examples of malicious data. In May 2002 year, the Norton Anti-Virus software for Windows operating systems detected around 61000 malicious programs. Several of them a
write a program to find the area under the curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits a and b
COMPUTER ORGANIZATION & ARCHITECTURE 1. What do you mean by digital computer? Explain the block diagram of a digital computer. 2. What do you mean by Difference Engine? Expl
The ?rst task in the project is to develop a sane system to store change logs and versions of ?les. The simplest approach is to create a "dot" directory in the location of the ?le
Q. Explain about Open System? The 'Open System' is a system within its environment. It receives input from environment as well as provides output to environment. Illustrati
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