Summary
In this chapter, we talked about multithreaded processing, ways to organize it, and avoiding unpredictable results caused by concurrent modification of the shared resource. We have shown you how to create threads and execute them using pools of threads. We have also demonstrated how results can be extracted from the threads that have completed successfully and discussed the difference between parallel and concurrent processing.
In the next chapter, we will provide you with a deeper understanding of JVM and its structure and processes, and we’ll discuss in detail the garbage-collection process that keeps memory from being overflown. By the end of the chapter, you will know what constitutes Java application execution, Java processes inside JVM, garbage collection, and how JVM works in general.