Z
Zoe Yu
Hi,
I have a question about Java sychronization. Suppose I have a
synchronized method M1() which writes to object X and performs other
operations, and I have an unsynchronized method M2() which also writes
to object X. In a multithreaded program, will concurrent write to
object X occur if thread 1 and thread 2 invoke M1() and M2()
simultaneously? What if both M1() and M2() are synchronized?
Thanks in advanced!
Regards,
Zoe
I have a question about Java sychronization. Suppose I have a
synchronized method M1() which writes to object X and performs other
operations, and I have an unsynchronized method M2() which also writes
to object X. In a multithreaded program, will concurrent write to
object X occur if thread 1 and thread 2 invoke M1() and M2()
simultaneously? What if both M1() and M2() are synchronized?
Thanks in advanced!
Regards,
Zoe