12 lines
No EOL
290 B
Markdown
12 lines
No EOL
290 B
Markdown
|
|
|
|
## What are three ways a thread **voluntarily** relinquishes the processor?
|
|
|
|
---
|
|
|
|
🙋
|
|
|
|
1. **`Thread.yield()`**: Explicitly giving up the processor.
|
|
2. **`Thread.sleep()`**: Ceasing execution for a specific time.
|
|
3. **`Object.wait()`**: Waiting for a notification from another thread.
|
|
|