Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

naive confusion about synchronization concept

 
Abhay Saini
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a thread exits a monitor for a particular object and when a thread exits via object.t.join()?
The difference between them is like when a thread finishes the function in which it was using that particular object, it exits out of it? Is this statement true?
or it exits out when object.t.join is used.
Because in definition of synchronization, its written that no other thread can access an object's monitor until any other thread already accessing it, has EXITED?

 
Abhay Saini
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone?
please
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all: PatienceIsAVirtue.

Getting and releasing a lock on an object and joining with another thread are two completely different things. Read about it here.
 
Abhay Saini
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for answering!
Joining threads is entirely a different thing in its working, that i know. All here it means is a way to end a thread.
All i want to know is that when a thread enters out of a lock, does it means it 'ends' or just that it has finished using that function or code which employed the use of the object whose monitor that particular thread is in?

I've posted this at stackoverflow too, will let you guys know if an answer is already by my side
 
Abhay Saini
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got a satisfactory reply there
bye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic