Construct with private and firstprivate clauses, Computer Networking

Assignment Help:

In this example we will see the use of parallel construct with private and firstprivate clauses. At the end of the program i and j remain undefined as these are private to thread in parallel construct.

#include

int main()

{

int i, j;

i = 1;

j = 2;

#pragma omp parallel private(i) firstprivate(j)

{

i = 3;

j = j + 2;

}

printf("%d %d\n", i, j); /* i and j are undefined */

return 0;

}

In the following example, each thread in the parallel region decides what part of the global array x to work on, based on the thread number.


Related Discussions:- Construct with private and firstprivate clauses

Distinguish between network devices computers and servers, The School of Co...

The School of Computing is planning to deploy a new network structure to accommodate the following scenario. Please make suggestions on how this LAN can be designed based on the fl

Describe the method of one way redistribution and mutual, Define  the conce...

Define  the concept of one way redistribution and mutual

Show about alternate mark inversion, Q. Show about Alternate mark inversion...

Q. Show about Alternate mark inversion? Bipolar AMI - Neutral, zero voltage represents binary 0 - Binary 1s symbolized by alternating positive and negative voltages

Determine the objectives of computer security, Determine the Objectives of ...

Determine the Objectives of computer security Though computerisation helps a lot in proper organisation of experience, it also opens a Pandora's Box simultaneously. On one

What are intrusion detection systems, Question : a) Give three example...

Question : a) Give three examples of vulnerable services which are among the overwhelming majority of successful attacks. b) Name the five outside sources which can be the

Explain persistence timer, Explain Persistence timer? To deal with ...

Explain Persistence timer? To deal with the zero-size windows What if a receiver advertises that the window size is 0 (by sending ACK) and this ACK is lost? - A

Classes and dotted decimal notation, The relationship between dotted decima...

The relationship between dotted decimal notation and classes is shown as follows. In class A the three octets managed to a host suffix. In class B the last most two octets ar

Differentiate between fast fading and slow fading, Differentiate between Fa...

Differentiate between Fast fading and Slow fading Fast fading refers to changes in signal strength among a transmitter and receiver as the distance among the two changes by a s

Determine the characteristics of thicknet, Thicknet Characteristics ...

Thicknet Characteristics It Supports transmission rates up to 10 Mbps in Baseband mode Less expensive in comparison of fiber-optic cable however more expensive than ot

Advantages of vpns - point to point , Advantages of VPNs Advantages di...

Advantages of VPNs Advantages discussed in the following  section include those related to security. Consolidation transparency cost. And administration. a. Improved secur

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd