O'Reilly logo

OCP Oracle® Certified Professional Java® SE 8 Programmer II by Scott Selikoff, Jeanne Boyarsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7 Concurrency

THE OCP EXAM TOPICS COVERED IN THIS CHAPTER INCLUDE THE FOLLOWING:

  • ✓  Java Concurrency
    • Create worker threads using Runnable, Callable, and use an ExecutorService to concurrently execute tasks
    • Identify potential threading problems among deadlock, starvation, livelock, and race conditions
    • Use synchronized keyword and java.util.concurrent.atomic package to control the order of thread execution
    • Use java.util.concurrent collections and classes including CyclicBarrier and CopyOnWriteArrayList
    • Use parallel Fork/Join Framework
    • Use parallel Streams including reduction, decomposition, merging processes, pipelines, and performance.

images

As you shall learn in Chapter 8, “IO,” and Chapter 10, “JDBC,” computers are capable of reading and writing data to external resources. Unfortunately, as compared to CPU operations, these disk/network operations tend to be extremely slow. So slow, in fact, that if your computer’s operating system were to stop and wait for every disk or network operation to finish, your computer would appear to freeze or lock up constantly.

Luckily, all modern operating systems support what is known as multi-threaded processing. The idea behind multi-threaded processing is to allow an application or group of applications to execute multiple tasks at the same time. This allows tasks waiting for other resources to give way to other processing requests. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required