summaryrefslogtreecommitdiffstats
path: root/src/H5Cpkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-11 02:26:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-11 02:26:34 (GMT)
commit3552beb08b10a9037691905b5dec644428a9ac35 (patch)
treef86885d94be4de02831c1cf3a0fb68633c837ee3 /src/H5Cpkg.h
parent60c9d88951866b4f8c9d0b8b7a04ac5a31d00edb (diff)
downloadhdf5-3552beb08b10a9037691905b5dec644428a9ac35.zip
hdf5-3552beb08b10a9037691905b5dec644428a9ac35.tar.gz
hdf5-3552beb08b10a9037691905b5dec644428a9ac35.tar.bz2
[svn-r22666] Description:
Merge "flush me last" & "flush me collectively" feature from the avoid_truncate branch back to the trunk. (To help enable allowing the free space section info to reside in temporary address space) Tested on: Mac OSX/64 10.7.4 (amazon) w/debug, gcc 4.7.x, C++, FORTRAN & threadsafe (h5committest forthcoming)
Diffstat (limited to 'src/H5Cpkg.h')
-rw-r--r--src/H5Cpkg.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 37068f1..909578b 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -282,6 +282,16 @@
* don't use this at present, I hope that this will allow
* some optimizations when I get to it.
*
+ * num_last_entries: The number of entries in the cache that can only be
+ * flushed after all other entries in the cache have
+ * been flushed. At this time, this will only ever be
+ * one entry (the superblock), and the code has been
+ * protected with HDasserts to enforce this. This restraint
+ * can certainly be relaxed in the future if the need for
+ * multiple entries being flushed last arises, though
+ * explicit tests for that case should be added when said
+ * HDasserts are removed.
+ *
* With the addition of the fractal heap, the cache must now deal with
* the case in which entries may be dirtied, moved, or have their sizes
* changed during a flush. To allow sanity checks in this situation, the
@@ -878,6 +888,7 @@ struct H5C_t
int32_t slist_len;
size_t slist_size;
H5SL_t * slist_ptr;
+ int32_t num_last_entries;
#if H5C_DO_SANITY_CHECKS
int64_t slist_len_increase;
int64_t slist_size_increase;
@@ -1964,6 +1975,10 @@ if ( (cache_ptr)->index_size != \
} else { \
(cache_ptr)->clean_index_size += (entry_ptr)->size; \
} \
+ if ((entry_ptr)->flush_me_last) { \
+ (cache_ptr)->num_last_entries++; \
+ HDassert((cache_ptr)->num_last_entries == 1); \
+ } \
H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \
}
@@ -1993,6 +2008,10 @@ if ( (cache_ptr)->index_size != \
} else { \
(cache_ptr)->clean_index_size -= (entry_ptr)->size; \
} \
+ if ((entry_ptr)->flush_me_last) { \
+ (cache_ptr)->num_last_entries--; \
+ HDassert((cache_ptr)->num_last_entries == 0); \
+ } \
H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \
}