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 services of Application Layer. Application Layer: As the highest layer within the OSI reference model, the application layer gives services to the users of OSI env
Bernstein Conditions for Detection of Parallelism For implementation of instructions or block of instructions in parallel, it should be guaranteed that the instructions are ind
Motherboard is called as motherboard because in the world all borned creature is directly attached to her mother & after it all the relations makes due to her mother so in the simi
Explain the characteristics and utilities available into java that makes it appropriate for developing e-commerce applications. Following are the characteristics and utilities
What is the system call available to transmit a signal? System call Kill is used to send a signal to a method or a group of processes. Int kill (pad tepid, Int sig); This
Q. What is monitoring-and-surveillance agents? ANSWER: Monitoring-and-surveillance agents or predictive agents are intelligent agents that examine and report on equipment.
Q. Explain about Instruction Register and Flags? The Instruction Register: It comprises the operation code (opcode) and addressing mode bits of the instruction. It assists in
Q. Define the Circular shifts ? Circular shifts ROTATE RIGHT andROTATE LEFT. Bits shifted out at one end of word are not lost as in a logical shift however are circulated back
Explain topology method used in LAN technology in detail. LAN Topologies: Network topology is a physical schematic that shows interconnection of the various users. There are
Enumerate in brief about the Intranet security policy An Intranet security policy is a very broad topic and it cannot be covered easily in few pages since it differs from situa
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