您在這裡

Parallel Programming

26 七月, 2019 - 09:47
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/5b6e61df-b830-48cb-9764-94696cb47c80@1.3

In 1985, by design, G was developed to address and simplify parallel programming. If you have gone through the examples in this book, you have already developed various parallel programs.

In the following example, we will develop a simple program where interactivity and parallelism are part of the program.

media/image1.png
Figure 9.1 Select Diagram for Parallel Programming  

From the menu select Edit »Copy.

media/image2.png
Figure 9.2 Copy Selected Diagram  

Create a copy of the while loop and its contents by selecting Edit »Paste. Organize the diagram as shown in the figure below.

media/image3.png
Figure 9.3 Paste Diagram  

Go the Front Panel window and organize the input and output controls as shown in the figure below.

media/image4.png
Figure 9.4 Parallel G Program  

You have just completed your first parallel interactive program using G. Save the program, run it and interact with it.

media/image5.png
Figure 9.5 Parallel Interactive G Program 

To end this program click on the stop and stop 2 terminals.