In terms of visualization, this program is quite simple. Every child thread is created, does a simple thing, and terminates. Only the main does a thread join. Therefore, we should not anticipate very much activities from this example.
Suppose we run this program with two sorted arrays, each of which has four elements. Run the program for a very short amount of time, we will see a Thread Status window similar to the following. Please keep in mind that you might not get a window exactly like the following because the execution behavior of a threaded program is dynamic that depends on may factors. As shown in the figure, the main program has created five threads, MergeA-0, MergeA-1, MergeA-2, MergeA-3 and MergeB-0. The first four are created to find the positions of array elements a[0], a[1], a[2] and a[3] in the merged array, and the fifth is created to find the position of b[0] in the merged array. The main thread is still running because there are three more threads to be created. Since each thread only does some simple task, three threads have terminated (i.e., MergeA-0, MergeA-1 and MergeA-2).
In the meantime, the History Graph windows shows the following. If you are careful, you should see that the thread names are the same as those in the Thread Status window. However, there are some minor differences. Please compare the content of these windows before continue.
What are the differences?
The following shows the Thread Status window near the end of execution. As you can see, all eight child threads have terminated and the main thread is joining.
The following History Graph window shows that the main thread has joined with four child threads because there are four JN tags shown.
Click on one of these four JN tags brings up the source window with the thread join statement highlighted.