O'Reilly logo

Java Thread Programming by Paul Hyde

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 3. Creating and Starting a Thread

IN THIS CHAPTER

This chapter explores more of the Thread API, including getting a handle on the currently executing thread, thread naming, some of the different constructors, and putting a thread to sleep for awhile. You will use these features to enhance the TwoThread example from Chapter 2, "A Simple Two-Thread Example."

Using Thread.currentThread()

At times, it's useful to know which of the threads currently running in the Java Virtual Machine (JavaVM) is executing a segment of code. In multithreaded programming, more than one thread may enter a method and ...

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