Start (); Starts the thread run (), the system calls sleep (int millsecond), sleeps for a period of time isalive (); Is active currentthread (); When the front-end interrupt (); Re-queue yield (); Pause the current thread, execute another thread
A thread pool is a collection of threads created when a multithreaded application is created, and then reused for new tasks instead of creating a new thread
Several states of a thread:
New state, ready state, running state, blocking state, death (termination) status
Thread Assignment Name:
threadtest T1 = new ThreadTest (); Thread t01 = new Thread (T1, "bread");
.....
if (i==3) {
Thread.yield ();
Thread.wait ();
}
.....
Object.notify ();
http://blog.csdn.net/kaka534/article/details/51849285
callerrunspolicy: The thread invokes the execute itself that runs the task
AbortPolicy: handler rejection will throw runtime rejectedexecutionexception
Discardpolicy: The task that cannot be performed will be deleted
Discardoldestpolicy: If the execution program has not been closed, the task in the head of the work queue is deleted, and then the execution of the program is retried (repeat this process if it fails again)
Java Thread (ii)