Question OS-SYNC-0047
MediumIn Java, what do wait() and notify() do inside a synchronized block?
- A.
Both release the lock permanently
- B.
They are used for file I/O
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Process Synchronization question
In Java, what do wait() and notify() do inside a synchronized block?
Both release the lock permanently
They are used for file I/O
Sign up free to see the answer and a step-by-step explanation.
wait() kills a thread; notify() starts it
wait() releases the lock and pauses the thread; notify() wakes one waiting thread