All right, all right! Interim decision regarding qualified Object methods

RivenTheMage riven-mage at id.ru
Thu Jul 12 05:36:17 PDT 2012


On Thursday, 12 July 2012 at 12:06:49 UTC, Roman D. Boiko wrote:
> Jon Skeet wrote on this long ago:

http://msmvps.com/blogs/jon_skeet/archive/2008/12/05/redesigning-system-object-java-lang-object.aspx

>The fact that every object has a monitor associated with it was a
>mistake in Java, and was unfortunately copied in .NET. This 
>promotes the bad practice of locking on "this" and on types - 
>both of which are typically publicly accessible references. I 
>believe that unless a reference is exposed explicitly for the 
>purpose of locking (like ICollection.SyncRoot) then you should 
>avoid locking on any reference which other code knows about.

This has been discussed multiple times on the D forum, I believe.


More information about the Digitalmars-d mailing list