Optional monitors suggestion

Yuriy via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 10 04:15:35 PDT 2014


On Monday, 8 September 2014 at 16:56:49 UTC, Andrei Alexandrescu
wrote:
> FWIW we could do this for backward compatibility: objects 
> without @monitor use the hashtable, and those with @monitor use 
> a field.

And that's exactly what current PR suggests. However, it's
stalled due to another issue. The implementation relies on
patching TypeInfo_Class in runtime, by adding a bit flag to the
TypeInfos of classes for which a monitor was allocated in the
hash-table at least once. This is done to tell GC (on
finalization) not to lookup monitors for classes that never used
it. So again, the main issue is modification of TypeInfo in
runtime, whereas it's supposed to be read-only. That's not my
opinion, I'm totally fine with writing a bit to "read-only"
memory. =)


More information about the Digitalmars-d mailing list