|
Boost : |
Subject: [boost] atomic lockpool and alignment
From: Jesper Storm Bache (jsbache_at_[hidden])
Date: 2013-05-17 11:49:24
I am new to this list, so I apologize if this has already been discussed.
boost_1_53_0/libs/atomic/src/lockpool.cpp contains:
static lockpool::lock_type lock_pool_[41];
On most systems, I would expect that lock_type becomes atomic<bool> v_;
I therefore seems to me that we are packing a large number of commonly used locks into sequential memory and therefore increasing the risk of false sharing due to cache line sharing.
At the same time, I expect that the 41 lock instances will be used frequently and as such it seems to make sense to align the array to a VM page boundary (to get only a single hot VM page).
Has alignment/padding been considered for the lock_pool implementation? If so what are the reasons for its dismissal?
Thanks,
Jesper Storm Bache
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk