[vtk-developers] Crashes after recent checkins

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Mon Aug 26 13:49:22 EDT 2013


This could be useful, it allow to easily implement safe static
initialization and is a generalization of what has been done in VTK. See
https://github.com/commontk/CTK/blob/master/Libs/Core/ctkSingleton.h

The idea would be to add a "vtkSingleton.h" class to VTK  ...

Hth
Jc


On Mon, Aug 26, 2013 at 1:36 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> C++ makes my head spin (and hurt!).
>
> Thanks Brad
>
> Not for the hurting head, but for the solution...
>
>
> On Mon, Aug 26, 2013 at 1:29 PM, Brad King <brad.king at kitware.com> wrote:
>
>> On 08/26/2013 12:05 PM, Berk Geveci wrote:
>> > Can you try this?
>>
>> From the patch:
>>
>> +  if (!vtkTimeStamp::GlobalTimeStamp)
>> +    {
>> +#if VTK_SIZEOF_VOID_P == 8
>> +    vtkTimeStamp::GlobalTimeStamp = new vtkAtomicInt64;
>>
>> This runtime initialization is not thread-safe, which IIUC
>> is the entire point of using an atomic integer.  We can
>> achieve proper static initialization and finalization using
>> the same Schwarz Counter idiom:
>>
>>  http://en.wikibooks.org/wiki/More_C++_Idioms/Nifty_Counter
>>
>> that we already use in several places.  It provides a way
>> to order things across translation units.
>>
>> -Brad
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>


-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130826/0fa0aa31/attachment.html>


More information about the vtk-developers mailing list