[vtk-developers] Change in VTK[master]: Added support for atomic integers.

Biddiscombe, John A. biddisco at cscs.ch
Tue Aug 20 16:59:39 EDT 2013


+1 for std::atomic

>>>
vtkNew<vtkObjectTypeFoo> obj;
mtime = obj.GetMTime();

// do something that might change obj

if (obj.GetMTime() > mtime)
   // do something else

As far as I know, this is the only design pattern the time stamp is designed for. Am I missing something?
<<<
as long as we understand that "do something that might change obj" could also be taking place on another thread.
>>
It sounds like the Barrier versions are equivalent to std::memory_order_seq_cst.
<<

and since operations will usually be of the kind
if obj1mtime>ob2mtime
ensuring memory order would be wise (I understand that best practice is to start with sequential order and gradually relax it when you are certain races can't take place)

JB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130820/da55e66c/attachment.html>


More information about the vtk-developers mailing list