Microsoft is working on it. Read about Software Transactional Memory.
- STM.NET
- STM.NET Team Blog
- Channel 9 Video: STM.NET: Who. What. Why.
- Papers on STM
They use a few different syntaxes:
// For those who like arrows
Atomic.Do(() => {
obj.Prop1 = value;
obj.Prop2 = value;
obj.Recalculate();
});
// For others who prefer exceptions
try {
obj.Prop1 = value;
obj.Prop2 = value;
obj.Recalculate();
}
catch (AtomicMarker) {
}
// we may get this in C#:
atomic {
obj.Prop1 = value;
obj.Prop2 = value;
obj.Recalculate();
}