Problems
Use the following problems to test your advanced programming prowess in virtual threads and structured concurrency in Java. I strongly encourage you to give each problem a try before you turn to the solutions and download the example programs:
- Tackling continuations: Provide a detailed explanation of what continuations are and how they work in the context of virtual threads.
- Tracing virtual thread states and transitions: Build a meaningful diagram of virtual thread states and transitions and explain it.
- Extending StructuredTaskScope: Explain and demonstrate the steps for extending the StructuredTaskScope. Explain why we cannot extendShutdownOnSuccessandShutdownOnFailure.
- Assembling StructuredTaskScope: Write a Java application that assembles (nests) multiple StructuredTaskScopeinstances.
- Assembling StructuredTaskScope with timeout: Modify the application developed in Problem 228 to add a timeout/deadline to the forked tasks.
- Hooking...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                