img
. . . . .
The Class java.lang.Thread
yield
public static void yield()
This causes the current thread to give up its LWP (or CPU) to another thread at the same or a
higher priority level (if any). It is legal for yield() to do nothing, so you must not rely on it.
Chapter 5.
Reference:
You probably will never use this function.
Comment:
setPriority getPriority
public final void setPriority(int newPriority)
throws SecurityException, IllegalArgumentException
public final int getPriority()
These change (return) the priority level of the thread. The priority level must be between
MIN_PRIORITY and MAX_PRIORITY if the thread group to which this thread belongs may set a
lower bound than MAX_PRIORITY.
Chapter 5.
Reference:
You probably will never use these functions.
Comment:
suspend
public final void suspend()
This causes the thread to stop running and wait until you call thread.resume(). Because
suspension is asynchronous, you have no idea what the target thread was doing when you
suspended it. For example, it may hold some locks that your other threads need. This makes it
virtually impossible to use.
Chapter 5.
Reference:
It has been deprecated in Java 2.
Comment:
resume
public final void resume()
This causes a suspended thread to resume.
Chapter 5.
Reference:
It has been deprecated in Java 2.
Comment:
MIN_PRIORITY MAX_PRIORITY NORM_PRIORITY
public final static int MIN_PRIORITY = 1;
public final static int MAX_PRIORITY = 10;
public final static int NORM_PRIORITY = 5;
These are the minimum, maximum, and default priorities for normal threads.
Chapter 5.
Reference:
You will probably never use these functions.
Comment:
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home