Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
118 #ifndef ATHENAKERNEL_RCUOBJECT_H
119 #define ATHENAKERNEL_RCUOBJECT_H
122 #include "GaudiKernel/ThreadLocalContext.h"
123 #include "GaudiKernel/EventContext.h"
124 #include "boost/dynamic_bitset.hpp"
213 typedef std::unique_lock<mutex_t>
lock_t;
226 const EventContext& ctx);
288 const EventContext& ctx,
289 boost::dynamic_bitset<>& grace)
const;
336 template <
typename...
Args>
345 template <
typename...
Args>
613 std::unique_lock<std::mutex>
m_g;
623 #endif // not ATHENAKERNEL_RCUOBJECT_H
Wrapper object controlled by RCU synchonization.
std::atomic< bool > m_dirty
True if there are any objects pending deletion.
ReadQuiesce_t readerQuiesce()
Return a reader for this RCUObject.
RCUObject(IRCUSvc &svc, NoObjectEnum)
Constructor, with RCUSvc.
const T * operator->() const
Access data.
IRCUObject(IRCUSvc &svc)
Constructor, with RCUSvc.
void update(std::unique_ptr< T > ptr)
Publish a new version of the data object.
const T & operator*() const
Access data.
Helper to update data in a RCUObject.
Read_t reader() const
Return a reader for this RCUObject.
std::unique_ptr< T > m_objref
Owning reference to the current object.
ReadQuiesce_t readerQuiesce(const EventContext &ctx)
Return a reader for this RCUObject.
IRCUSvc * m_svc
The service with which we're registered, or null.
virtual bool clearOld(lock_t &, size_t nold)=0
Delete old objects.
virtual void clearAll(lock_t &) override
Delete all objects.
RCURead(const RCUObject< T > &rcuobj)
Constructor.
void quiescent(const EventContext &ctx)
Declare the event slot ctx of this object to be quiescent.
virtual ~IRCUObject()
Destructor.
RCUReadQuiesce(RCUObject< T > &rcuobj, const EventContext &&ctx)=delete
RCUReadQuiesce(RCUObject< T > &rcuobj, const EventContext &ctx)
Constructor.
const EventContext & m_ctx
The current event context.
mutex_t & mutex()
Return the mutex for this object.
bool endGrace(lock_t &, const EventContext &ctx, boost::dynamic_bitset<> &grace) const
Declare that the grace period for a slot is ending.
RCUReadQuiesce< T > ReadQuiesce_t
size_t m_nold
Number of old objects.
Update_t updater(const EventContext &ctx)
Return an updater for this RCUObject.
std::deque< std::unique_ptr< const T > > m_garbage
List of objects pending cleanup.
IRCUObject(const IRCUObject &)=delete
virtual bool clearOld(lock_t &, size_t nold) override
Delete old objects.
std::atomic< const T * > m_obj
Pointer to the current object.
std::unique_lock< std::mutex > m_g
Lock for synchonization.
RCUObject< T > & m_rcuobj
The RCUObject we're referencing.
RCUObject(const RCUObject &)=delete
~RCUReadQuiesce()
Destructor.
boost::dynamic_bitset m_grace
Bit[i] set means that slot i is in a grace period.
Some weak symbol referencing magic...
void discard(std::unique_ptr< const T > p)
Queue an object for later deletion.
RCUUpdate(RCUObject< T > &rcuobj, const EventContext &ctx)
Constructor.
Helper to read data from a RCUObject.
void makeOld(lock_t &lock, size_t garbageSize)
Make existing pending objects old, if possible.
Interface for RCU service.
void discard(lock_t &, std::unique_ptr< const T > p)
Queue an object for later deletion.
std::mutex m_mutex
The mutex for this object.
void quiescent()
Declare the current event slot of this object to be quiescent.
std::unique_lock< mutex_t > lock_t
AthROOTErrorHandlerSvc * svc
RCUObject< T > & m_rcuobj
The object we're referencing.
const T * operator->() const
Access data.
IRCUObject & operator=(const IRCUObject &)=delete
RCUUpdate(RCUObject< T > &rcuobj)
Constructor.
RCUObject(RCUObject &&other)
Move constructor.
RCUUpdate(RCUObject< T > &rcuobj, const EventContext &&ctx)=delete
void setGrace(lock_t &)
Declare that all slots are in a grace period.
const T * m_obj
The data object we're reading.
ReadQuiesce_t readerQuiesce(const EventContext &&ctx)=delete
Update_t updater()
Return an updater for this RCUObject.
const EventContext & m_ctx
The event context.
Update_t updater(const EventContext &&ctx)=delete
Base object class for RCU-style synchronization for Athena.
RCUObject(size_t nslots, Args &&... args)
Constructor, with number of slots.
virtual void clearAll(lock_t &)=0
Delete all objects.
bool endGrace(lock_t &lock, const EventContext &ctx)
Declare that the grace period for a slot is ending.
RCUObject & operator=(const RCUObject &)=delete
setBGCode setTAP setLVL2ErrorBits bool
RCUReadQuiesce(RCUObject< T > &rcuobj)
Constructor.
Helper to read data from a RCUObject.
const T & operator*() const
Access data.
boost::dynamic_bitset m_oldGrace
Same thing, for the objects marked as old.
NoObjectEnum
Value to pass to a constructor to mark that we shouldn't allocate an object.
RCUObject(IRCUSvc &svc, Args &&... args)
Constructor, with RCUSvc.