From c031e5af2156cd48e63553fed2a4b2442293fda9 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Wed, 23 Feb 2011 14:17:48 -0800 Subject: [PATCH] CDentry/CDir/CInode: Add comment on use of boost::pool. Signed-off-by: Greg Farnum --- src/mds/CDentry.h | 7 +++++++ src/mds/CDir.h | 8 ++++++-- src/mds/CInode.h | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/mds/CDentry.h b/src/mds/CDentry.h index ca3f2f97649d2..127dddc977a10 100644 --- a/src/mds/CDentry.h +++ b/src/mds/CDentry.h @@ -50,6 +50,13 @@ bool operator<(const CDentry& l, const CDentry& r); // dentry class CDentry : public MDSCacheObject, public LRUObject { + /* + * This class uses a boost::pool to handle allocation. This is *not* + * thread-safe, so don't do allocations from multiple threads! + * + * Alternatively, switch the pool to use a boost::singleton_pool. + */ + private: static boost::pool<> pool; public: diff --git a/src/mds/CDir.h b/src/mds/CDir.h index 3790dfe189f6b..3d312dc46d14d 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -43,9 +43,13 @@ class bloom_filter; class ObjectOperation; ostream& operator<<(ostream& out, class CDir& dir); - - class CDir : public MDSCacheObject { + /* + * This class uses a boost::pool to handle allocation. This is *not* + * thread-safe, so don't do allocations from multiple threads! + * + * Alternatively, switch the pool to use a boost::singleton_pool. + */ private: static boost::pool<> pool; public: diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 3c79245320d20..a534f394391a0 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -93,6 +93,13 @@ WRITE_CLASS_ENCODER(default_file_layout); // cached inode wrapper class CInode : public MDSCacheObject { + /* + * This class uses a boost::pool to handle allocation. This is *not* + * thread-safe, so don't do allocations from multiple threads! + * + * Alternatively, switch the pool to use a boost::singleton_pool. + */ + private: static boost::pool<> pool; public: -- 2.39.5