Construct with private and firstprivate clauses, Computer Networking

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.

Posted Date: 3/4/2013 5:20:35 AM | Location : United States







Related Discussions:- Construct with private and firstprivate clauses, Assignment Help, Ask Question on Construct with private and firstprivate clauses, Get Answer, Expert's Help, Construct with private and firstprivate clauses Discussions

Write discussion on Construct with private and firstprivate clauses
Your posts are moderated
Related Questions
Latest Internet and Intranet technologies Even though the security capabilities of the latest Internet and Intranet technologies have enabled the companies to control the avail

Describe Circuit switching, Packet switching and Virtual Circuit Packet switching. Explain their suitability for different applications such as telephone and internet. Packet S

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

Operating system for Clients All of the clients running popular operating systems such as Microsoft Windows, Mac OS, UNIX, etc., could be used to function as backbone software

What is Ring topology The network consists of a set of repeaters joined by point-to-point links in a closed loop. Each station attaches to the network at a repeater and can tra

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

using binary adition, what is the result of 1010 + 10? Using binary addition, how would you repeatedly increment a number by 2?

What is the different type of networking / internetworking devices? Repeater: Also called a regenerator, it is an electronic device that operates only at physical layer. I


What is Project 802? It is a project begins by IEEE to set standards that enable intercommunication among equipment from a variety of manufacturers. It is a way for specifying