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!
Example Programmes for Parallel Systems
Now we shall complete this with the examples on shared memory programming.
Example 13: Adding elements of an array using two processor int sum, A[ n] ; //shared variables
void main ( ){
int i ;
for (i=0; i // now create process to be implemented 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 implemented 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, the last half of the array is passed to processor P1 which adds them. Meanwhile processor P0 adds the first half of the array. The variable sum is locked to avoid inconsistency.
// now create process to be implemented 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 implemented 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, the last half of the array is passed to processor P1 which adds them. Meanwhile processor P0 adds the first half of the array. The variable sum is locked to avoid inconsistency.
IEEE 802.3 frame format
is DVMRP multicast prtocol supports IPV6?
Write a report on your chosen topic that has been approved by your Lecturer. Your report should include appropriate figures, about 2000 words. Topics: 1 MAN- Metro Ethernet 2 Inte
Half duplex is analogous to a one a lane bridge, it can handle traffic in both directions but no at the similar time.
State in brief about the Graceful degradation With FDMA or TDMA, a fixed number of users can concurrently access the system. Though, with CDMA, as more user concurrently access
Recognize the two items that TCP and UDP share in common? Ans) TCP and UPD are both layer 4 Transport protocols and both use port number to recognize upper level applications.
Question: (a) Explain and illustrate different architectures for IEEE802.11 (WiFi). (b) The MAC management of IEEE802.11 handles transmitter activity for power management.
Question 1: ‘There is an overwhelming imperative for organisations to analyse every bit of information they can extract from their huge data warehouses for competitive advant
Q. Microwave Applications? - Unicasting - one-to-one communication among sender and receiver - Cellular phones - Satellite networks - Wireless LANs
A mobile host (MH) is connected to a WLAN access network that uses MIP for mobility support. Consider that the RTTs between MH and HA are 0.3s while RTTs within a L2 subnet are 80
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