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

Define carrier sense multiple access collision avoidance, Carrier Sense Mul...

Carrier Sense Multiple Access/Collision Avoidance a) Necessary since wireless LANs cannot implement CSMA/CD b) Collision detection requires increased bandwidth requirements

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

What are the key elements of protocols, What are the key elements of protoc...

What are the key elements of protocols? The key elements of protocols are a. Syntax   It refers to the structure or format of the data that is the order in which they a

Disk encryption and block cipher, Suppose AES (or any block cipher) is used...

Suppose AES (or any block cipher) is used to encrypt data. Which mode of encryption covered in class is best suited for each of the following two scenarios and why? If more than on

State briefly about fddi media, FDDI Media Class B or SAS (single-attac...

FDDI Media Class B or SAS (single-attachment stations) attach to one ring Class A or DAS (dual attachment stations) attach to both rings. SASs is attached to the primary rin

State the list of protocols supported by the intranet, State the list of pr...

State the list of protocols supported by the Intranet The following is the list of protocols supported by the Intranet: ARP: Address resolution Protocol is used to resol

Example on TCP numbering, Q. Example on TCP numbering? Envision a TCP c...

Q. Example on TCP numbering? Envision a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for every seg

Define in details about computer networks, Define in details about compute...

Define in details about computer networks ? Discuss a variety of types of networks topologies in computer network. Also discuss a variety of costs and disadvantage of all topology

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