Possible language changes

Doug Lea dl at cs.oswego.edu
Sat Mar 5 13:38:19 GMT 2005


I wrote:


> 
> In Java, we covered similar cases with atomics by allowing compilers to
> secretly use otherwise-inaccessible locks. But I bet that won't work in
> C++ because it changes sizeof's.
> 

I realized while editing doc that this solution IS always possible
in C++ although at a possibly big expense. You can hash objects with
wide volatiles to static collection of associated locks, hence not
affecting object sizes. Not nice, but possible. And all you need
is an existence proof here to keep the option alive.

-Doug






More information about the cpp-threads mailing list