Threads aren't a new idea: many operating systems and languages support them. But despite widespread support, threads tend to be something that everyone talks about, but few use. Programming with threads has a reputation for being tricky and nonportable. However, Java's thread facilities are easy to use and completely portable between platforms. Revised to cover Java 1.2, this text focuses on Java's thread facilities, showing: where to use threads to increase efficiency, how to use them effectively, and how to avoid common mistakes. It covers the Thread and ThreadGroup classes, the Runnable interface, and the language's synchronized operator. It explains thread scheduling ends by developing a CPUSchedule class, showing how to implement a scheduling policy. Extended examples include classes that implement reader/writer locks, general locks, locks at arbitrary scope, and asynchronous I/O.
- ISBN10 1449366651
- ISBN13 9781449366650
- Publish Date 10 September 2004 (first published 23 February 1999)
- Publish Status Active
- Imprint O'Reilly Media
- Edition 3rd ed.
- Format eBook
- Pages 362
- Language English