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
Quetion: An amplifier increases the peak-to-peak voltage of a signal from 1 V to 20 V. What is the amplifier's gain in dB?

Q. Show Data link and Physical vs Subnet? - Data link layer The function of the Data Link Layer is -offers for the control of the physical layer and detects and possib


Q. What are the Error Correction Techniques ? Error Correction Error Correction Techniques Retransmission Forward Error Correction Burst Error Corre

Describe about the Network equipment and connectivity Network equipment and connectivity should address various networking equipments such as routers, types of cables, as well


Name the factors that affect the performance of the network? a. Number of Users b. Type of transmission medium c. Hardware d. Software

In a network that contains two servers and twenty workstations, where is the best place to install an Anti-virus program? An anti-virus program must be installed on all servers

What is Security solutions Though there are a number of security solutions available due to sophistication in technology, there are a number of risks and difficulties attached

Buffering This  protocols  provides  the advantage of buffering to the  receiver can buffer any out of order  packets after being received by  sending  acknowledgment  when