Collection attributes are not flushed correctly when using concurrent-evaluation.

Issue #289 resolved
Alfred Åkesson created an issue

When using the grammar

A::= B*; B;

with the collection attribute

coll ArrayList<B>;
B contributes this to;

the code gets an error

 A a = new A();
 a.addB(new B());
 a = a.treeCopy();
 a.addB(new B());
 testEqual(2,; // becomes 1

when compiled with concurrent-evaluation.

For test see:

Comments (4)

  1. Jesper Öqvist

    When developing concurrent evaluation I did not implement flushing. I think I was planning to add that later, but forgot about it. Flushing should not be difficult to implement, though, so I'll see if I can add it quickly now.

    Flushing will only be safe if no other thread concurrently tries to evaluate an attribute.

  2. Jesper Öqvist

    Implement flushing for concurrent evaluation

    ASTNode.flushTreeCache() was not implemented when generating code for concurrent evaluation. This makes flushing work with concurrent evaluation. However, note that flushing is only safe if no other thread is concurrently evaluating attributes or trying to flush the cache.

    fixes #289 (bitbucket)

    → <<cset 7219bc7f39fd>>

  3. Log in to comment