|
Boost : |
From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-09-07 12:14:31
Larry Evans wrote:
> Greg Colvin wrote:
>
>> At 08:45 AM 9/7/2002, Larry Evans wrote:
>>
>>
>> Tell me more about how you are using Lin's method.
>>
> Pretty much the same way I used it in my earlier
> GarbageCollectionByTemplateSpecialization folder in files.
Since I removed this folder, I guess that remark is not much help.
Also, maybe you're asking how it works and how a variable is
declared:
1)How it works:
It works by doing essentially the same as the global, except only
locally, i.e. each time an arc is deleted, it:
a) traverses the graph from that vertex, decrementing the refcounts.
(like your phase, SCAN)
b) traverses again, detected any refcounts <> 0
(like your phase, MARK)
c) traverses again, collecting the unmarked and restoring counts
of marked
(like your remaining phases)
2)How variable declared:
; typedef boost::cyclic_count_gc<GcMeth,IpMeth> count_type
; typedef subj0<count_type> subj_type
; typedef shared_cyclic_ptr<subj0,count_type> prox_type
; prox_type p(new subj_type)
Obviously, it would be slower than yours since a traverse is made each time
an arc is removed AND a subgraph traverse is made each phase instead of
only in the middle phase. Its only advantage is that it recovers memory
immediately,
even if there are cycles. With global mark scan (i.e. your method) the
collection
is delayed until the user actually calls the collect function.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk