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.
Printers are devices which put ink on paper in a controlled manner. They manually produce photographic images orreadable text. Printers have gone through a large transition in tech
Q. Make a generalized program that accepts a number & base, convert it into the given base. Perform necessary validations.
This assignment consists of design and development of an information system. The first part of the assignment consists of the design, which includes construction of ER and DFD diag
IDA* Search - artificial intelligence: A* search is a sophisticated and successful search strategy. In fact, a problem with A* search is that it must keep all states in its me
What is a Demultiplexer ? Ans. Demultiplexer has similar circuit as decoder but here E is obtained as the particular input line, the output lines are similar as decode
Perform the - 48 - 23 operations using the 2's complement method. Ans. - 48 - 23 = - 48 + (-23) -48 = 1 1 0 1 0 0 0 0 -23 = 1 1 1 0 1 0 0 1 = -71
Create Perl scripts as required below: a) Create a script named select_by_attribute.pl that accepts the name of a LibML documentand the name of a particular attribute from the c
Q. Describe about Physical Systems? Physical Systems are tangible entities which may be dynamic or static. Computer Systems, Buildings,Vehicles etc. are illustrations of p
Input-Output-Processor Interconnection Network (IOPIN) This interconnection network is used for communication between I/O channels and processors. All processors commune with a
With a C program to read the text book number, title, author and publisher into a structure and print these values. # include # include void main() { struct boo
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