[Trilinos-Users] Using NOX on a tbb thread

Bartlett, Roscoe A. bartlettra at ornl.gov
Thu Jan 17 13:13:58 MST 2013


There is a plan for making the Teuchos Memory Memory Management classes thread safe for all the use cases consistent with Trilinos usage described in:

    https://software.sandia.gov/bugzilla/show_bug.cgi?id=5201

The motivation for the development of the Teuchos Memory Management classes and the comparison to boost or C++11 reference counting classes is described in:

    http://www.ornl.gov/~8vt/TeuchosMemoryManagementSAND.pdf

Especially see section 5.14.

However, getting a more complex use case like yours to work will likely require a good bit more than just tread safe memory management classes.  But, the utilities to allow the Teuchos Memory Management classes to be thread safe with make the rest of the work much easier.

Cheers,

-Ross

P.S.  If boost would have provided something like the SharedAccessPolicy proposed in the above bug ticket instead of hard-coding it into the boost::shared_ptr implementation, this would have likely been done a long time ago.  However, now that we have C++11 and TBB, we can likely do this pretty quickly when one or the other is available.

> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-
> bounces at software.sandia.gov] On Behalf Of Holger Brandsmeier
> Sent: Thursday, January 17, 2013 2:51 PM
> To: <trilinos-users at software.sandia.gov>
> Subject: [Trilinos-Users] Using NOX on a tbb thread
> 
> Mark,
> 
> what is currently the thread safety for Teuchos::RCP? Is it as for
> boost::shared_ptr? So smething like "boost::shared_ptr<> offers a
> certain level of thread safety. The reference count is manipulated in
> a thread safe manner (unless you configure boost to disable threading
> support)."
> 
> -Holger
> 
> On Thu, Jan 17, 2013 at 8:14 PM, Hoemmen, Mark <mhoemme at sandia.gov>
> wrote:
> > Teuchos::RCP itself is not currently thread safe, so if the threads are sharing
> references to the same data, you may have problems with reference
> counting.  This would include things like setting parameters with an
> RCP<ParameterList>; the different solvers shouldn't share those.  We have a
> plan for making RCP thread safe, but haven't had time to work on this yet.
> 
> 
> 
> 
> --
> Holger Brandsmeier, SAM, ETH Zürich
> http://www.sam.math.ethz.ch/people/bholger
> 
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list