|
Boost : |
Subject: Re: [boost] concurrent garbage collector
From: Taylor Holliday (taylor_at_[hidden])
Date: 2013-06-23 00:08:40
Hey Bjorn,
Excellent points! I'll make those changes :-)
Thanks!
- Taylor
On Jun 22, 2013, at 1:16 AM, Bjorn Reese wrote:
> On 06/17/2013 10:41 PM, Taylor Holliday wrote:
>
>> https://gist.github.com/wtholliday/5793270
>
>
> I like the idea.
>
> Some minor comments:
>
> In the Collect() function the sequence is a static local variable. You
> may consider making it a normal member variable (you have already
> declared the "collector" variable as static.)
>
> Apropos, you may consider using boost::call_once instead of using a
> Meyers singleton, because the latter is not thread-safe.
>
> In the mark phase you use an std::vector as a stack. It may be better to
> use std::stack.
>
> In the sweep phase you collect a new set and then assign it to the
> old. You should probably use one of these instead:
>
> _nodes.swap(newNodes);
>
> or if you are going for a C++11 only solution:
>
> _nodes = std::move(newNodes);
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk