Chapter 2Division of Labor

The most effective way to do it is to do it.

Amelia Earhart

The long-awaited multicore processor arrives tomorrow, and you can’t wait to see how the app you’re building runs on it. You’ve run it several times on a single core, but you’re eager to see the speedup on the new machine. Is the speedup going to be in proportion to the number of cores? More? Less? A lot less? I’ve been there and have felt the struggle to arrive at a reasonable expectation.

You should’ve seen my face the first time I ran my code on a multicore and it performed much worse than I had expected. How could more cores yield slower speed? That was years ago, and I’ve grown wiser since and learned a few lessons along the way. Now I have better instinct ...

Get Programming Concurrency on the JVM 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.