cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: Continuation invalidation strategy
Date Wed, 11 May 2005 14:55:44 GMT
>> summing up: we have to keep whole continuation tree, right?

Well... not really we only need to carefully
distinguish between invalidation and removal.
There are two models of continuation trees:

1. differential


                  C1
                  /\
                 /  \
                C2  C3
                /
               /
              C4

 C4 cannot live without C2 and C1
 C2 cannot live without C1
 C3 cannot live without C1

 The state is being constructed

  state = C4 + C2 + C1

 So although we can invalidate C1
 (which means no more child continuations
 may be created) it may still not be removed
 from the tree unless all childs are also
 marked invalid.

2. full


                  C1
                  /\
                 /  \
                C2  C3
                /
               /
              C4

 C1-C4 are self contained

 The state is being constructed

  state = C4

 Invalidation may remove the continuation
 from the tree immediatly. (of course we
 might up with a forrest then)

                  -o-

So IMO the invalidation (or better garbage
collection) algorithm should work like this:

We have a janitor invalidating continuations
that has not been used for a certain amount
of time. They can be invalidated from flow
directly. The interpreter will refuse to
resume the flow from them.

If a leaf continuation is being invalidated
it means that we need to walk from the leaf
to the root. If all childs of the current node
are marked invalidated it may be removed.
Otherwise we stop the processing.

...does that make sense?

cheers
--
Torsten

Mime
View raw message