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 the transport layer in detail. Transport Layer: The transport layer controls and makes sure the end-to-end integrity of the data message propagated by the network am
Explain the techniques, which are used to gain on the number pairs. In rural areas, subscribers are usually dispersed. This is both unessential and expensive to give a dedicate
Give difference between compiler and interpreter. Compiler: It is a translator for machine independent HLL as FORTRAN and COBOL etc. Interpreter: It analysis the source
Q. Illustration of a memory organization? Let's consider an illustration of a memory organization as displayed in Figure below in that main memory can store 32K words of 12 b
What is a disk drive? The electro mechanical mechanism that spins the disk and moves the read/write heads known as disk drive.
Multiple valued logics: Multiple valued logics, where altered types of truth value such as "unknown" are may be allowed. These have some of the particular advantages of fuzzy
Define bidirectional bus? A bidirectional bus is that which permits the transfer of data either from memory to CPU during a read operation or from CPU to memory during write op
Write the truth table of NOR gate. Ans. The truth table for NOR gtae is shown below:
Enumerate about the Specialised hardware Specialised hardware such as protected memory or cryptographic memory module for storing and protecting the keys proves to be a good s
Real time (transaction) processing In real time (transaction) processing files are generally updated in real time (for example when booking flights on an airplane); however in
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