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.
Types of Pipelines: Instructional pipeline It is used where different stages of an instruction fetch and execution take place in a pipeline. Arithmetic pipeline
Some of the plug-ins have proven unstable. These have been moved into a split download, which should be available anywhere you got the GIMP, in the file gimp-plugins-unstable-VERSI
What is NEG instruction Arithmetic sign inversion or two's complement (NEG). NEG instruction two's complements a number which means that arithmetic sign of a signed number cha
Except ions of type error in JAVA are handled by? Except ions of type error in the JAVA are handled through JAVA run time environment.
Give explanation about the use of SSL to secure the network. SS L stands for Secure Sockets Layer is a protocol developed through Netscape for transmitting private document
Question: a) What are the reasons for feedback in a control system? b) What are the roles of the configuration and fault managers in a real-time system? c) What are stimu
Name the fundamental kinds of memory used in microprocessor systems There are three fundamental kinds of memory used in microprocessor systems - generallyknown asRAM, ROM, and
Web server security through SSL (Secure Socket Layer) As it is well known that the Intranets and internet are purely based on use of powerful web servers to deliver information
Determine about the Authoring Software Also termed as author ware; this is a program which helps in the writing of hypertext or multimedia applications. Authoring tools general
Q. What is span of control? Span of control tells the ratio among superiors and subordinates. Generally organizations are having two different types of spans. They are Wide Spa
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