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.
Application Using Shift Operations Rotate and Shift instructions are helpful even for division andmultiplication. These operations are not normally available in high-level lang
State the advantages of CMOS. Ans. Subsequent are the advantages of CMOS: Both n-channel and p-channel devices are fabricated on similar substrate. Low power di
Q. Returns information about present virtual machine? int pvm_parent( void ) Returns the tid of process which spawned the calling process. int pvm_tidtohost(
MINI PROJECT ON UNIVERSITY SCHEMA
Differentiate between exception and validation testing. - Validation testing is done to test the software in conformance to the needs specified. It aims to demonstrate that the
Define Mapping and List mapping procedure? The transformation of data from main memory to cache memory is known as an Mapping. Associative mapping Direct mapping
Episodes - artificial intelligence: If an agent's current choice of action not based on its past reactions, then the environment is known as episodic. In the non-episodic envi
What is Server in SAP terminology? A component can having of one process or a group and is then known as the server for the respective service.
Question 1 What are the different schemes in power management? Explain 2 Explain the functions of parallel port in detail 3 (a) List and explain the functions of keyboard
State 0 Source control is being dragged with the variety of a target. 1 Out of the variety of a target. 2 One position in the target to one another.
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