Use the following problems to test your concurrency programming prowess. I strongly encourage you to give each problem a try before you turn to the solutions and download the example programs:
- Thread life cycle states: Write several programs that capture each life cycle state of a thread.
- Object- versus class-level locking: Write several examples that exemplify object- versus class-level locking via thread synchronization.
- Thread pools in Java: Provide a brief overview of thread pools in Java.
- Thread pool with a single thread: Write a program that simulates an assembly line for checking and packing up bulbs using two workers.
- Thread pool with a fixed number of threads: Write a program that simulates an assembly line for checking and packing up bulbs using multiple workers.
- Cached and scheduled thread pools: Write a program that simulates an assembly line for checking...