Thread and program flow control

/*
I have a program that starts a bunch of threads after init. The main program will pause its execution, and waits for the threads to finish. Now, I can only think of a pooling loop to syn the program flow. Is there a better way to avoid this busy pooling loop?
*/

One way or another, I believe that you'll have to check to see if the threads are still alive. If you know that each thread is going be terminated smoothly (ie. it won't be killed by another thread) then you can have an array of booleans. Each thread would initialize it's member in the array to true when the thread starts, and would set it to false when it finished. This way you wouldn't have to poll the threads, but would be able to poll the array instead. Make this array an instance variable so that all threads can access it.

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…

Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java.
Define …

Viewers will learn about basic arrays, how to declare them, and how to use them.
Introduction and definition:
Declare an array and cover the syntax of declaring them:
Initialize every index in the created array:
Example/Features of a basic arr…