Re: Question about synchronized
- From: "John C. Bollinger" <jobollin@xxxxxxxxxxx>
- Date: Mon, 14 Nov 2005 01:32:38 -0500
Chris Uppal wrote:
Thomas G. Marshall wrote:
John C. Bollinger wrote:
Yes. You should think of synchronization as protecting sections of code -- either blocks or methods -- not objects.
Yes! And where were you when I was getting railed on for making such a claim in september '04?
I also wondered if "John" is being spoofed, or possibly has been taken over by mind-eating aliens ;-)
If I deny it will you believe me? :-)
For the record: /I/ am still me, and so am unchanged in my opinion that talking of "protecting sections of code" is badly misleading...
It looks like I really stepped in it. I think, however, that this debate is more about terminology and personal mental models than it is about conflicting understanding among us (Chris, Thomas, and me) of how synchronization affects program behavior. The OP was clearly confused about the implications of objects having associated monitors, and at this point I predict that he will indeed have more success in understanding the behavior of multithreaded programs if he focuses his attention on which sections of his code need to be synchronized, on which monitor. I think in any case that he has taken the point, which is that locking an object's monitor does not prevent access to any unsynchronized part of any object's behavior.
-- John Bollinger jobollin@xxxxxxxxxxx .
- Follow-Ups:
- Re: Question about synchronized
- From: Chris Uppal
- Re: Question about synchronized
- References:
- Question about synchronized
- From: Matthias Kaeppler
- Re: Question about synchronized
- From: John C. Bollinger
- Re: Question about synchronized
- From: Chris Uppal
- Question about synchronized
- Prev by Date: Re: Question about synchronized
- Next by Date: Re: jni.h problem
- Previous by thread: Re: Question about synchronized
- Next by thread: Re: Question about synchronized
- Index(es):
Relevant Pages
|