[vtk-developers] Data structures in VTK

Simon Warfield warfield at bwh.harvard.edu
Tue Jan 1 08:55:23 EST 2002


On Mon, Dec 31, 2001 at 10:54:40AM -0500, Bill Hoffman wrote:
> This comes up every once and a while.   VTK has several link-lists, arrays and 
> hash tables scattered about the code.   Every once and a while, someone comes along,
> and says, hey we should centralized these classes so they are not duplicated which is 
> obviously bad.   Then it is said that we should not do that because these classes are
> too hard to write, and STL will save us.   However, every time we try to use STL in
> a project, it becomes a maintenance/portability nightmare.   STL pushes compilers to the limit.
>
> In Insight, we are now including an ENTIRE copy of STL and the stream library in the source
> CVS tree because ONE systems compiler does not ship with a thread safe version of those 
> libraries.   

I'm not clear on the problem.  Is it a bad thing that you didn't need to
implement a portable thread-safe container library but could instead just drop
in one of the existing packages ?

I think the system you are refering to is SGI.  What is the problem with SGI 
iostreams and threads anyway ? 
Here is SGI on thread safe STL:
http://www.sgi.com/tech/stl/thread_safety.html

> I have a fear that if we adopted STL in VTK, within a month we would not only be
> maintaining a list, array and hash table class, but rather an entire implementation
> of the c++ standard library (as we have done for ITK).   

 Would it be wrong to select a c++ standard library and drop it in as a third
party library ?  It would be exactly the same as VTK current does with
tcl or python.
 
> Not even taking the thread issue into consideration, with cmake, it has been very difficult
> to support some of the compilers as VTK uses.  (have a look at cmStandardIncludes.h in cmake)
> 
> So the question is how long should VTK wait.   If it is more than a year, then I think
> it would be better to consolidate the existing containers scattered about VTK, then just
> saying that we should use STL when it works, and not fixing the existing problem of duplicated
> container code.
> 
> -Bill
> 
> At 01:41 PM 12/28/2001 -0500, Lorensen, William E (CRD) wrote:
> >Certainly we should look at STL. For example, I believe that CMake uses some stl. Insight (the NLM
> >toolkit) uses it heavily, but does have some portability problems.
> >
> >For example, SGI does not ship an STL that is thread safe. (OK the story is longer than that).
> >For Insight, we have to build a development from SGI.
> >
> >It takes a long time to get these sorts of things right. I would discourage any more STL like classes
> >in vtk.
> >
> >Bill
> >
> >-----Original Message-----
> >From: Prabhu Ramachandran [mailto:prabhu at aero.iitm.ernet.in]
> >Sent: Friday, December 28, 2001 1:27 PM
> >To: vtk-developers at public.kitware.com
> >Subject: Re: [vtk-developers] Data structures in VTK
> >
> >
> >>>>>> "SW" == Simon Warfield <warfield at bwh.harvard.edu> writes:
> >
> >    SW> Does it really make sense to continue to avoid using STL ?
> >
> >    SW> If vendor STLs are still too incompatible and not compliant
> >    SW> with the standard, then one option would be to use a drop in
> >    SW> replacement for vendor STL such as STLport
> >    SW> http://www.stlport.com/product.html
> >
> >Yes, with more than 20 different compilers being supported it is
> >certainly unfair to say STLport is not cross platform.  However, maybe
> >the biggest worry is that by adding STLPort VTK will rope in another
> >dependency, which might not be desired.  So unless compilers ship with
> >a working STL it might not make sense to use STL.  That said, I find
> >it hard to believe that STL is not standard enough today.
> >
> >prabhu
> >_______________________________________________
> >vtk-developers mailing list
> >vtk-developers at public.kitware.com
> >http://public.kitware.com/mailman/listinfo/vtk-developers
> >_______________________________________________
> >vtk-developers mailing list
> >vtk-developers at public.kitware.com
> >http://public.kitware.com/mailman/listinfo/vtk-developers 
> 
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers

-- 
Simon Warfield, Ph.D. warfield at bwh.harvard.edu Phone:617-732-7090
http://www.spl.harvard.edu/~warfield           FAX:  617-582-6033
Assistant Professor of Radiology,          Harvard Medical School
Thorn 329, Department of Radiology,  Brigham and Women's Hospital 
75 Francis St, Boston, MA, 02115



More information about the vtk-developers mailing list