Boost logo

Boost Users :

Subject: [Boost-users] [Interprocess] uint64 atomic
From: dnj0496 (dnj0496_at_[hidden])
Date: 2017-05-30 21:47:14


Hi,
I am new to boost-interprocess. I am trying to store some of my data
structures in shared memory using boost::interprocess. Each of my data
structure(s) contain a bunch of counters (basically size_t values) updated
atomically. In the traditional world, std::atomic supports atomic update for
size_t. However, I came to know that boost::interprocess doesn't support
atomic update for uint64.

I've looked at pairing my counter with a lock for synchronization purposes.
I've implemented it and it seems to work. However, the upgradable_mutex is
consuming 144bytes while my counter is 8bytes(size_t) making it cost
prohibitive. Alternatively, I could use one lock for all the counters of a
class to spread the cost but that'd affect the performance and affect
parallelism.

I'd appreciate it if someone could offer any alternate suggestions. Thanks.

Dk.

--
View this message in context: http://boost.2283326.n4.nabble.com/Interprocess-uint64-atomic-tp4695000.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net