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.
Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.
Scott Oaks is a Java Technologist at Sun Microsystems, where he has worked since 1987. While at Sun, he has specialized in many disparate technologies, from the SunOS kernel to network programming and RPCs. Since 1995, hes focused primarily on Java and bringing Java technology to end-users. Scott also authored OReillys Java Security, Java Threads and Jini in a Nutshell titles.
Henry Wong is a tactical engineer at Sun Microsystems, where he has worked since 1989. Originally hired as a consultant to help customers with special device drivers, kernel modifications, and DOS interoperability products, Henry has also worked on Solaris ports, performance tuning projects, and multithreaded design and implementations for benchmarks and demos. Since early 1995, Henry has been involved in developing Java prototypes and supporting customers who are using Java. Prior to joining Sun, Henry earned a bachelor of science degree in chemical engineering from The Cooper Union in 1987. He joined a small software company in 1986 working on SCSI device drivers, image and audio data compression, and graphics tools used for a medical information system. When not in front of a computer, Henry is an instrument rated private pilot, who also likes to dabble in archery, cooking, and traveling to different places with his wife, Nini.
Preface; Who Should Read This Book?; Versions Used in This Book; Organization of This Book; Conventions Used in This Book; Feedback for Authors; Acknowledgments; Chapter 1: Introduction to Threading; 1.1 Java Terms; 1.2 Thread Overview; 1.3 Why Threads?; 1.4 Summary; Chapter 2: The Java ThreadingAPI; 2.1 Threading Using the Thread Class; 2.2 Threading Using the Runnable Interface; 2.3 The Life Cycle of a Thread; 2.4 Thread Naming; 2.5 Thread Access; 2.6 More on Starting, Stopping, and Joining; 2.7 Summary; Chapter 3: Synchronization Techniques; 3.1 A Banking Example; 3.2 Reading Data Asynchronously; 3.3 A Class to Perform Synchronization; 3.4 The Synchronized Block; 3.5 Nested Locks; 3.6 Deadlock; 3.7 Return to the Banking Example; 3.8 Synchronizing Static Methods; 3.9 Summary; Chapter 4: Wait and Notify; 4.1 Back to Work (at the Bank); 4.2 Wait and Notify; 4.3 wait(), notify(), and notifyAll(); 4.4 wait() and sleep(); 4.5 Thread Interruption; 4.6 Static Methods (Synchronization Details); 4.7 Summary; Chapter 5: Useful Examplesof Java Thread Programming; 5.1 Data Structures and Containers; 5.2 Simple Synchronization Examples; 5.3 A Network Server Class; 5.4 The AsyncInputStream Class; 5.5 Using TCPServer with AsyncInputStreams; 5.6 Summary; Chapter 6: Java Thread Scheduling; 6.1 An Overview of Thread Scheduling; 6.2 When Scheduling Is Important; 6.3 Scheduling with Thread Priorities; 6.4 Popular Scheduling Implementations; 6.5 Native Scheduling Support; 6.6 Other Thread-Scheduling Methods; 6.7 Summary; Chapter 7: Java Thread Scheduling Examples; 7.1 Thread Pools; 7.2 Round-Robin Scheduling; 7.3 Job Scheduling; 7.4 Summary; Chapter 8: Advanced Synchronization Topics; 8.1 Synchronization Terms; 8.2 Preventing Deadlock; 8.3 Lock Starvation; 8.4 Thread-Unsafe Classes; 8.5 Summary; Chapter 9: Parallelizing for Multiprocessor Machines; 9.1 Parallelizing a Single-Threaded Program; 9.2 Inner-Loop Threading; 9.3 Loop Printing; 9.4 Multiprocessor Scaling; 9.5 Summary; Chapter 10: Thread Groups; 10.1 Thread Group Concepts; 10.2 Creating Thread Groups; 10.3 Thread Group Methods; 10.4 Manipulating Thread Groups; 10.5 Thread Groups, Threads, and Security; 10.6 Summary; Miscellaneous Topics; Thread Stack Information; General Thread Information; Default Exception Handler; The ThreadDeath Class; The Volatile Keyword; Exceptions and Errors; InterruptedException; InterruptedIOException; NoSuchMethodError; RuntimeException; Colophon;
Le informazioni nella sezione "Su questo libro" possono far riferimento a edizioni diverse di questo titolo.
Da: Better World Books, Mishawaka, IN, U.S.A.
Condizione: Good. 2nd Edition. Pages intact with minimal writing/highlighting. The binding may be loose and creased. Dust jackets/supplements are not included. Stock photo provided. Product includes identifying sticker. Better World Books: Buy Books. Do Good. Codice articolo 2693527-6
Quantità: 1 disponibili
Da: Better World Books, Mishawaka, IN, U.S.A.
Condizione: Very Good. 2nd Edition. Pages intact with possible writing/highlighting. Binding strong with minor wear. Dust jackets/supplements may not be included. Stock photo provided. Product includes identifying sticker. Better World Books: Buy Books. Do Good. Codice articolo 2693528-6
Quantità: 1 disponibili
Da: Half Price Books Inc., Dallas, TX, U.S.A.
paperback. Condizione: Very Good. Connecting readers with great books since 1972! Used books may not include companion materials, and may have some shelf wear or limited writing. We ship orders daily and Customer Service is our top priority! Codice articolo S_446749624
Quantità: 1 disponibili
Da: ThriftBooks-Atlanta, AUSTELL, GA, U.S.A.
Paperback. Condizione: Very Good. No Jacket. May have limited writing in cover pages. Pages are unmarked. ~ ThriftBooks: Read More, Spend Less. Codice articolo G1565924185I4N00
Quantità: 1 disponibili
Da: Bay State Book Company, North Smithfield, RI, U.S.A.
Condizione: good. The book is in good condition with all pages and cover intact, including the dust jacket if originally issued. The spine may show light wear. Pages may contain some notes or highlighting, and there might be a "From the library of" label. Boxed set packaging, shrink wrap, or included media like CDs may be missing. Codice articolo BSM.YQC4
Quantità: 1 disponibili
Da: AwesomeBooks, Wallingford, Regno Unito
Condizione: Very Good. This book is in very good condition and will be shipped within 24 hours of ordering. The cover may have some limited signs of wear but the pages are clean, intact and the spine remains undamaged. This book has clearly been well maintained and looked after thus far. Money back guarantee if you are not satisfied. See all our books here, order more than 1 book and get discounted shipping. . Codice articolo 7719-9781565924185
Quantità: 2 disponibili
Da: Bahamut Media, Reading, Regno Unito
Condizione: Very Good. Shipped within 24 hours from our UK warehouse. Clean, undamaged book with no damage to pages and minimal wear to the cover. Spine still tight, in very good condition. Remember if you are not happy, you are covered by our 100% money back guarantee. Codice articolo 6545-9781565924185
Quantità: 2 disponibili
Da: Better World Books Ltd, Dunfermline, Regno Unito
Condizione: Very Good. 2nd Edition. Former library copy. Pages intact with possible writing/highlighting. Binding strong with minor wear. Dust jackets/supplements may not be included. Includes library markings. Stock photo provided. Product includes identifying sticker. Better World Books: Buy Books. Do Good. Codice articolo 15302636-75
Quantità: 1 disponibili
Da: The Book Spot, Sioux Falls, MN, U.S.A.
Paperback. Condizione: New. Codice articolo Abebooks438048
Quantità: 1 disponibili
Da: Hay-on-Wye Booksellers, Hay-on-Wye, HEREF, Regno Unito
Condizione: Very Good. Used book, some minor shelf wear to cover, otherwise fine. Codice articolo 086386-3
Quantità: 1 disponibili