O'Reilly logo

Developing Games in Java™ by Bret Barker, David Brackeen, Laurence Vanhelsuwé

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 1. Java Threads

KEY TOPICS

  • What Is a Thread?

  • Creating and Running Threads in Java

  • Synchronization

  • Using wait() and notify()

  • The Java Event Model

  • When to Use Threads

  • When Not to Use Threads

  • Sum It Up: Thread Pools

  • Summary

It's lunchtime, and you decide to treat yourself to a meal at your favorite restaurant. You take a seat and look around—the place is pretty empty. There's one waiter, one customer eating, and you.

The waiter is helping the other customer, but oddly, you're being ignored. Even when you ask for a menu, the waiter acts as if you're not there and just refills the other customer's beverage. Finally, after the other customer leaves, the waiter acknowledges your existence and helps you.

So what is the problem? The waiter hasn't been fired, ...

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