| Author |
naive confusion about synchronization concept
|
Abhay Saini
Greenhorn
Joined: Jun 15, 2011
Posts: 19
|
|
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
Joined: Jun 15, 2011
Posts: 19
|
|
anyone?
please
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
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.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Abhay Saini
Greenhorn
Joined: Jun 15, 2011
Posts: 19
|
|
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
Joined: Jun 15, 2011
Posts: 19
|
|
got a satisfactory reply there
bye
|
 |
 |
|
|
subject: naive confusion about synchronization concept
|
|
|