[Halld-online] Boost shared_ptr for Hall D Online
Graham Heyes
heyes at jlab.org
Mon Dec 21 10:31:43 EST 2009
This is nice in principle but can you guarantee that you will run Linux, and in particular that the Boost shared pointer will be there, for the lifetime of GLUEX and hall-D? We are still five years or so from taking data in large volumes and I would hope that hall-D will be around for a few years after that. I know that CODA uses some third party libraries etc but Boost is a Linux only deal right now.
My 10c worth,
Graham
On Dec 21, 2009, at 10:20 AM, Elliott Wolin wrote:
> Hi,
>
> The Boost shared pointer (a type of smart pointer) appears now to be
> standard on linux (I found it on my 32-bit and on my 64-bit RHEL
> machines). I think we should seriously consider using it for the Hall D
> online. See:
>
> http://www.boost.org/doc/libs/1_41_0/libs/smart_ptr/shared_ptr.htm
>
> for details.
>
> My proposal would be to outlaw "bare" pointers for all but the most
> trivial tasks (and for backwards-compatibility in some cases), and use
> the shared_ptr extensively. At some point I or someone else will give a
> report on this at the Online meeting. This is not an urgent decision,
> of course.
>
> Briefly, the shared_ptr class wraps a standard pointer in such a way as
> to eliminate memory leaks. It keeps a reference count of the number of
> places the wrapped ptr is being used, and guarantees that delete() is
> called when it is not being used any more (very similar to what is done
> in Java).
>
> The Online is fortunate that no real code has been developed yet and we
> can adopt the shared_ptr before we start. I think it would be a great
> idea for the offline to use it as well, but they 1) must support other
> architectures where it may not be standard yet, and 2) already have a
> large base of code.
>
> Thanks,
>
> --
>
> Sincerely,
> Elliott
>
>
> ================================================================================
>
>
> Those raised in a morally relative or neutral environment will hold
> no truths to be self-evident.
>
>
> Elliott Wolin
> Staff Physicist, Jefferson Lab
> 12000 Jefferson Ave
> Suite 8 MS 12A1
> Newport News, VA 23606
> 757-269-7365
>
> ================================================================================
>
> _______________________________________________
> Halld-online mailing list
> Halld-online at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-online
More information about the Halld-online
mailing list