[ Pobierz całość w formacie PDF ]
.They now check to seewhether any notification is necessary and then use notifyAll()to broadcast an event to all waiting threads.SummaryThis chapter was a whirlwind tour of multithreaded programmingin Java.Among other things, the chapter covered the following:Creating your own thread classes by subclassingThread or implementingRunnableUsing the ThreadGroupclass to manage groups of threadsUnderstanding thread states and threadschedulingMaking your classes thread-safe by usingthe synchronized keywordto protect objects from concurrent modificationUnderstanding how monitors affect concurrentprogramming in JavaCoordinating the actions of multiple threadsby calling the wait()and notify() methodsJava threads are not difficult to use.After reading this chapter,you should begin to see how threads can be used to improve youreveryday Java programming.Contactreference@developer.com with questions or comments.Copyright 1998EarthWeb Inc., All rights reserved.PLEASE READ THE.Copyright 1998 Macmillan Computer Publishing.All rights reserved
[ Pobierz całość w formacie PDF ]