Optional monitors suggestion

Yuriy via Digitalmars-d digitalmars-d at puremagic.com
Wed May 14 06:33:28 PDT 2014


On Wednesday, 14 May 2014 at 13:07:32 UTC, bearophile wrote:
> I'd like to know why you think D classes should not have the 
> monitor on default (this means why you don't plan for a 
> @no_pointer).
There are 4 reasons for that.
1. I'm thinking of monitors as members of Object class, so all 
other classes have monitors just because they are inheriting it. 
So with my proposal you would be able to add a monitor, but not 
remove it.
2. Mutex synchronization is pretty old-school approach, there's a 
lot of cons to using it, and thus it should not be carved into 
the language core.
3. I can't imagine a project that has more than 10% of it's 
classes being synchronized on, so this feature looks like more 
often unneeded than needed.
4. I consider D a killemall language, that may be potentially 
used on tiny AVRs and PICs, where polymorphism might be welcome, 
but an extra pointer for each class instance may become a 
blocker. I know, thats fantasy now, but i think it's crucial to 
keep this concept of D.


More information about the Digitalmars-d mailing list