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

Categories of encryption - decryption, Q. Categories of Encryption - Decryp...

Q. Categories of Encryption - Decryption ? Categories of Encryption/Decryption - Symmetric-key - encryption key (Ke) and the decryption key (Kd) are the same and secret

Explain the term- encryption, Explain the term- Encryption Because all ...

Explain the term- Encryption Because all of the user traffic, as well as control traffic, is digitized in second generation systems, it is a relatively simple matter to encrypt

What is bookmark, What is Bookmark A list of pages a user likes to f...

What is Bookmark A list of pages a user likes to frequently visit. Netscape® Navigator and Explorer® have a "bookmark" menu item which allows users to add favourite sites vi

Explain different network structures in use, Computer Networking 1. Exp...

Computer Networking 1. Explain different network structures in use. 2. Elaborate the architecture and usage of ISDN. 3. Discuss the concept of framing in Data Link Layer

What is a lan, What is a LAN? LAN stands for Local Area Network. It ref...

What is a LAN? LAN stands for Local Area Network. It refers to the connection among computers and other network devices that are located within a small physical location.

Connection establishment - tcp connection management, Connection Establishm...

Connection Establishment TCP transmits  data in full duplex mode. When two TCP is two machines are  connected they are able  to send segments to each other simultaneously. This

Controlling and monitoring access to the intranet, Controlling and monitori...

Controlling and monitoring access to the Intranet Digital certificates provide excellent means of controlling and monitoring access to the Intranets. The certificate itself act

Show the communication between switches in VLAN, Q. Show the Communication ...

Q. Show the Communication between Switches? Communication between Switches - Must know which station belongs to which VLAN as well as membership of stations connected to

Give some examples of private network addresses, Give some examples of priv...

Give some examples of private network addresses. 10.0.0.0 with a subnet mask of 255.0.0.0 172.16.0.0 with subnet mask of 255.240.0.0 192.168.0.0 with subnet mask of 255.2

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