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

Layer 2 switch, A typical layer 2 switch has a number of features. Identify...

A typical layer 2 switch has a number of features. Identify and explain 5 features that you think are important that you would consider in your evaluation of L2 switches offered b

Tcp, how tcp is redefined for wireless network

how tcp is redefined for wireless network

compute maximum current and properties of an ideal op-amp, Questions: ...

Questions: 1. A 5V Zener diode has a maximum power dissipation of 2W. What is the maximum current that can be safely passed through the device? 2. List three properties of a

Routing in a wan, As there will be more devices there will be more traffic ...

As there will be more devices there will be more traffic of information. We can include capacity to WAN by adding more links and packet switches. Packet switches use not have compu

Explain network services, Explain Network Services Network services are...

Explain Network Services Network services are the thing that a network can do. The main networking services are File Services: This contains file transfer, storage, data m

Determine the term - backend lan, Determine the term - Backend LAN Back...

Determine the term - Backend LAN Backend networks are used to interconnect large systems like mainframes, supercomputers, and mass storage devices. The key needs here is for bu

Link layer process, Each link layer process will have two connections: one ...

Each link layer process will have two connections: one "up" to the appropriate IP layer process, and one "sideways" to the link layer process on the simulated machine at the other

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