Java Threading Question and Answers
5. | Can you explain Yielding in threading? |
---|---|
It causes the currently executing thread object to temporarily pause and allow other threads to execute. | |
6. | What is thread safety and synchronization? |
---|---|
|
|
7. | How to stop a thread? |
---|---|
thread.stop; | |
8. | What are monitors? |
---|---|
Monitor is a body of code which can be executed by only one thread at a time. If any other thread tries to get access at the same time, it will be suspended until the current thread releases the monitor. | |