GeeCON Prague 2014*
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


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: 77

A detailed explanation would be appreciated.

Thanks,
Shivom
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

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: 42028
    
  64
The FAQ to the rescue: https://www.coderanch.com/how-to/java/WaitAndNotifyInObjectClass


Ping & DNS - my free Android networking tools app
Shivom Shukla
Ranch Hand

Joined: Jul 05, 2012
Posts: 77

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??