This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Why does the wait(), Notify() etc methods lie in the Object class and not thread class?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Why does the wait(), Notify() etc methods lie in the Object class and not thread class??" Watch "Why does the wait(), Notify() etc methods lie in the Object class and not thread class??" New topic
Author

Why does the wait(), Notify() etc methods lie in the Object class and not thread class??

Shivom Shukla
Ranch Hand

Joined: Jul 05, 2012
Posts: 74

A detailed explanation would be appreciated.

Thanks,
Shivom
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 484

In my opinion, because every Java object has a lock which can be acquired/released so these operations should be of the object's behavior.


PM Me If You Want to get Urgent Help on Java Programming
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39571
    
  27
The FAQ to the rescue: https://www.coderanch.com/how-to/java/WaitAndNotifyInObjectClass


Ping & DNS - updated with new look and Ping home screen widget
Shivom Shukla
Ranch Hand

Joined: Jul 05, 2012
Posts: 74

Thank you Ulf and Nam,

This is a great Link Ulf.

Regards,
Shivom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does the wait(), Notify() etc methods lie in the Object class and not thread class??
 
Similar Threads
andrew has wii
can non-static inner class access any member
WA #1.....word association
Doubt about diagram class (realization)
Math class immutable