This blog records some ideas, notes, and information of my works and studies in information technology.

Monday, November 9, 2009

SCJD Exam with J2SE 5.0--Chapter 4

Current page: p.102
There are three ways in controlling threads:
  1. Waiting
    Implicitly wait for competitive resources
    Explicitly wait by calling myObject.wait();
        
    --> myObject.notify(); or myObject.notifyAll(); can wake up waiting threads
  2. Yielding
    The thread gives up its order to other thread but doesn't release its resources!!
    myThread.yield();
    It's suitable for using it before processing a complicated task!!
  3. Blocking
  4. Sleeping
    Wait for at least a specified amount of time.

No comments:

Post a Comment