1. wait/notification mechanism
What is waiting, notice? For example, there is a restaurant, the chef is responsible for cooking, the waiter is responsible for serving, when the dishes are done, the waiter will need to wait, imagine, if no notice, the waiter will be every once in a while to see the food in the end, and at this time there is a lot of work to do, so he will do a lot of useless Then after the notice, the chef after the dish, the speaker or other way to inform the waiter needs to serve, so that the waiter only receive notice when the end of the dish, you can be relieved to busy the front of the matter.
1. What is the wait and notice mechanism implemented?
Implemented by the Wait (), notify (), or Notifyall () method. All three of these methods belong to the object class.
Wait () is the thread that waits, notify ()
Inter-thread communication