public ReadGraphImpl forRecompute(CacheEntry parent) {
return new ReadGraphImpl(null, parent, processor);
}
+
+ public ReadGraphImpl forSyncExecute() {
+ return withParent(null, null, true);
+ }
public static ReadGraphImpl create(QueryProcessor support) {
ReadGraphImpl result = new ReadGraphImpl(null, null, support);
public void fireListeners(ReadGraphImpl graph) {
+ ReadGraphImpl listenerGraph = graph.forSyncExecute();
+ listenerGraph.asyncBarrier.inc();
+ fireListeners_(listenerGraph);
+ listenerGraph.asyncBarrier.dec();
+ listenerGraph.asyncBarrier.waitBarrier(this, listenerGraph);
+
+ }
+
+ private void fireListeners_(ReadGraphImpl graph) {
+
assert (!processor.updating);
assert (!processor.cache.collecting);
assert (!firingListeners);
public void propagateChangesInQueryCache(final ReadGraphImpl graph) {
+ ReadGraphImpl syncGraph = graph.forSyncExecute();
+ syncGraph.asyncBarrier.inc();
+ propagateChangesInQueryCache_(syncGraph);
+ syncGraph.asyncBarrier.dec();
+ syncGraph.asyncBarrier.waitBarrier(this, syncGraph);
+
+ }
+
+
+ public void propagateChangesInQueryCache_(final ReadGraphImpl graph) {
+
// Make sure that listening has performed its work
listening.sync();
public void invalidateResource(final int resource) {
if(lastInvalidate == resource) return;
- scheduledValueUpdates.add(resource);
+ //scheduledValueUpdates.add(resource);
+ scheduledInvalidates.add(resource);
lastInvalidate = resource;
cache.dirty = true;
}
// start = System.nanoTime();
queryProvider.propagateChangesInQueryCache(graph);
- ReadGraphImpl listenerGraph = graph.forRecompute(null);
- listenerGraph.asyncBarrier.inc();
- queryProvider.listening.fireListeners(listenerGraph);
- listenerGraph.asyncBarrier.dec();
+ queryProvider.listening.fireListeners(graph);
+
+// ReadGraphImpl listenerGraph = graph.forRecompute(null);
+// listenerGraph.asyncBarrier.inc();
+// queryProvider.listening.fireListeners(listenerGraph);
+// listenerGraph.asyncBarrier.dec();
+
// duration = System.nanoTime() - start;
// System.out.println("performScheduledUpdates " + 1e-9*duration + "s. ");