Summary

In this chapter, you learned a lot of things. First of all, we refactored the code to be ready for further development that uses parallel guessing. We got acquainted with processes and threads, and we even mentioned fibers. After that, we looked at how Java implements threads and how to create code that runs on multiple threads. Additionally, we saw the different means that Java provides to programmers needing parallel programs, starting threads, or just starting some tasks in already existing threads.

Perhaps the most important part of this chapter that you should remember is the metaphor of bureaucrats and the different speeds. This is extremely important when you want to understand the performance of concurrent applications. And I hope that this is a catchy picture, which is easy to remember.

There was a huge topic about the different synchronization means that Java provides, and you have also learned about the pitfalls that programmers can fall into when programming concurrent applications.

Last but not least, we created the concurrent version of the Mastermind guesser and also measured that it is indeed faster than the version that uses only one processor (at least on my machine). We used the Java Microbenchmark Harness with the Gradle build tool and discussed, a bit, how to perform microbenchmarking.

This was a long chapter and not an easy one. I may tend to think that this is the most complex and most theoretical one. If you understood half of it at first read, you can be proud. On the other hand, be aware that this is only a good base to start experimenting with concurrent programming and there is a long way to being senior and professional in this area. And, it is not an easy one. But first of all, be proud of yourself at the end of this chapter.

In the following chapters we will learn more about web and web programming. In the very next chapter we will develop our little game so that it can run in a server and the player can play with it using a web browser. This will establish the basic knowledge for web programming. Later we will build on this developing web based service applications, reactive programming and all the tools and areas that will make a professional Java developer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.70.247