lundi 2 février 2015

How is atomicity of reference operations enforced?


In managed languages how is atomicity of reference operations enforced?


On some platforms references have to be at least 64 bit, so it cannot rely on usually atomic 32 bit word operations...


Is it done simply through the use of locks? Wouldn't that be considered too costly in terms of performance?


EDIT: To be more precise I didn't mean all reference operations, I mean mostly assignment which is atomic in for example .NET and Java. But even assignment is not obviously atomic since on most platforms you cannot reliably change value of 64 bit word in atomic way...





Aucun commentaire:

Enregistrer un commentaire