synchronized vs. C volatile

BCS none at anon.com
Mon Aug 9 07:29:24 PDT 2010


Hello SK,

> Does 'synchronized' mean the exact same thing as the C 'volatile'
> qualifier when applied to basic types?
> As in:
> synchronized int x;

I'm reasonably sure that it doesn't. I think synchronized invokes a mutex 
for access and C's volatile just suppresses some optimizations.

-- 
... <IXOYE><





More information about the Digitalmars-d mailing list