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

Explain semantic web , What the Semantic Web is? Ans) The Semantic Web ...

What the Semantic Web is? Ans) The Semantic Web is a vision, that thinks to join together dispersed bits of data on the internet, very much like web pages are presently joined

Record route ip option, The address recorded by a router should be its outg...

The address recorded by a router should be its outgoing interface. That is, if a router forwards a datagram that has the record route option enabled, and if the datagram arrives at

Illustrate about rsa encryption, Q. Illustrate about RSA Encryption? R...

Q. Illustrate about RSA Encryption? RSA Encryption - Public key encryption technique - Encryption steps: - Encode data to be encrypted as a number to create the pla

Uses of fragmentation and reassembly, Uses of fragmentation and reassembly ...

Uses of fragmentation and reassembly The More bit is used for fragmentation and reassembly. If this bit is 0, then either there has been no fragmentation of this packet or this

Issues with bridges connecting different lans, Issues with Bridges Connecti...

Issues with Bridges Connecting Different LANs - Frame format - differences in frame structure, fields used (example Ethernet to Token Ring) - Payload size - size of data en

Two commands that save the running-config to a tftp server, Name the two co...

Name the two commands that save the running-config to a TFTP server Ans)  Two commands are:- a) copy running tftp  b) write network

Research, I have a research in this topic " Mitigating DoS Attacks against ...

I have a research in this topic " Mitigating DoS Attacks against Broadcast Authentication in Wireless Sensor Networks " with simulation

Modern computer , modern technology in world of 21 century

modern technology in world of 21 century

Output port - network layer and routing , Output Port The function of t...

Output Port The function of the  port is  take  the packets that have  been stored in the out  put port  memory and transmits them over the out going  link. The queuing  and bu

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