summaryrefslogtreecommitdiffstats
path: root/include/framework/structure
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-02-14 15:34:39 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2025-02-14 15:34:39 -0500
commitffbca7e200d8e7937592cd4a70d41f4d6ed9cb65 (patch)
tree4cae9e8e75c0718b635d5b7788a288982fe4efd4 /include/framework/structure
parentd28f2cfcd4249fc7d984762a326e3f2d6dcba7dc (diff)
downloaddynamic-extension-ffbca7e200d8e7937592cd4a70d41f4d6ed9cb65.tar.gz
Parallel background reconstructions appear to be working!
Diffstat (limited to 'include/framework/structure')
-rw-r--r--include/framework/structure/InternalLevel.h1
-rw-r--r--include/framework/structure/MutableBuffer.h15
2 files changed, 13 insertions, 3 deletions
diff --git a/include/framework/structure/InternalLevel.h b/include/framework/structure/InternalLevel.h
index 7e8e87d..6e8b67e 100644
--- a/include/framework/structure/InternalLevel.h
+++ b/include/framework/structure/InternalLevel.h
@@ -200,7 +200,6 @@ public:
void delete_shard(shard_index shard, bool log_delete=true) {
size_t before = m_shards.size();
- fprintf(stderr, "[D]\tReconstruction deleting shard %ld %p\n", shard, m_shards[shard].first.get());
m_shards.erase(m_shards.begin() + shard);
size_t after = m_shards.size();
assert( before > after);
diff --git a/include/framework/structure/MutableBuffer.h b/include/framework/structure/MutableBuffer.h
index 0197ecd..105f0f3 100644
--- a/include/framework/structure/MutableBuffer.h
+++ b/include/framework/structure/MutableBuffer.h
@@ -149,13 +149,22 @@ public:
/* refuse to advance head while there is an old with one references */
if (m_old_head.load().refcnt > 0) {
- // fprintf(stderr, "[W]: Refusing to advance head due to remaining
- // reference counts\n");
+ //fprintf(stderr, "[W]: Refusing to advance head due to remaining reference counts\n");
return false;
}
m_active_head_advance.store(true);
+ if (m_old_head.load().refcnt > 0) {
+ //fprintf(stderr, "[W]: Refusing to advance head due to remaining reference counts [2]\n");
+ m_active_head_advance.store(false);
+ return false;
+ }
+
+ // fprintf(stderr, "[I] Advancing head pointer: %ld %ld %ld\n", m_old_head.load().head_idx, m_head.load().head_idx, new_head);
+ // fprintf(stderr, "[I] Refcnts: %ld %ld\n", m_old_head.load().refcnt, m_head.load().refcnt);
+
+
buffer_head new_hd = {new_head, 0};
buffer_head cur_hd;
@@ -179,6 +188,8 @@ public:
buffer_head cur_hd, new_hd;
bool head_acquired = false;
+
+ //fprintf(stderr, "[I]: getting head %ld %ld %ld\n", target_head, m_old_head.load().head_idx, m_head.load().head_idx);
do {
if (m_old_head.load().head_idx == target_head) {
cur_hd = m_old_head.load();