- edited description
Collection attributes are not flushed correctly when using concurrent-evaluation.
When using the grammar
#!
A::= B*; B;
with the collection attribute
#!
coll ArrayList<B> A.bs();
B contributes this to A.bs();
the code gets an error
A a = new A();
a.addB(new B());
testEqual(a.bs().size(),1);
a.flushTreeCache();
a = a.treeCopy();
a.flushTreeCache();
a.addB(new B());
testEqual(2,a.bs().size()); // a.bs().size() becomes 1
when compiled with concurrent-evaluation.
For test see: https://bitbucket.org/jastadd/jastadd-test/pull-requests/7/test-related-to-issue-289/diff
Comments (4)
-
reporter -
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.
-
- changed status to resolved
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>>
-
- changed component to concurrent
- Log in to comment