And you are right. A thread without the lock can run
unsynchronized method "and change the data".
So, all the methods which are modifying and accessing the data in
critical section should be synchronized to prevent
data corruption.
Originally posted by Sushma:
Hi,
Can u pl throw more light on 'locking on the monitor of the object'?
A synchronised method can call a non synchronised method, so if this is true, what if some other thread which could access thsi method changed the data in this and this was called by the synchronized method???
I'm really confused....Pl help me.
Regards,
Sushma
[This message has been edited by Sushma (edited May 11, 2000).]
[This message has been edited by Sushma (edited May 11, 2000).]
[This message has been edited by bongadi (edited May 11, 2000).]