Here are the various thread examples we discussed in class.
The first example is taken from the textbook. We looked at two versions, one where each thread was treated separately, and one where a thread pool was set up. The thread pool version is active, the other version is in the code, but commented out.
Next, here is the graphics example, involving four labels with changing numbers.
This example was discussed in class, and is in the book in a somewhat different form. It involves 100 tasks each running in a separate thread, each adding one penny to a single bank account.. As was seen in class, synchronization can be introduced, where the comment in Account says.
Finally we have the example involving the computation of the greatest common divisor of several integers, dividing the work over several threads. I discussed the ideas in class.