Extending the Game - Run Parallel, Run Faster

In this chapter, we will extend the Mastermind game. As it is now, it can guess the secret that was hidden and it also can hide the pegs. The test code can even do both at the same time. It can play against itself, leaving us only with the fun of programming. What it cannot do is make use of all the processors that we have in today's notebooks and servers. The code runs synchronous and utilizes only a single processor core.

We will alter the code extending the guessing algorithm in order to slice up the guessing into subtasks and execute the code in parallel. In so doing, we will get acquainted with Java concurrent programming. This will be a huge topic, with many subtle twists and turns lurking ...

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.