mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Introduce callbacks for the FairMQUnmanagedRegion.
Callbacks are called when the data buffer of the message assiciated with the corresponding region is no longer needed by the transport. Example in examples/advanced/Region/
This commit is contained in:
committed by
Mohammad Al-Turany
parent
378c47c5e5
commit
58a312b730
76
fairmq/shmem/Common.h
Normal file
76
fairmq/shmem/Common.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
#ifndef FAIR_MQ_SHMEM_COMMON_H_
|
||||
#define FAIR_MQ_SHMEM_COMMON_H_
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||
|
||||
namespace fair
|
||||
{
|
||||
namespace mq
|
||||
{
|
||||
namespace shmem
|
||||
{
|
||||
|
||||
struct DeviceCounter
|
||||
{
|
||||
DeviceCounter(unsigned int c)
|
||||
: fCount(c)
|
||||
{}
|
||||
|
||||
std::atomic<unsigned int> fCount;
|
||||
};
|
||||
|
||||
struct RegionCounter
|
||||
{
|
||||
RegionCounter(unsigned int c)
|
||||
: fCount(c)
|
||||
{}
|
||||
|
||||
std::atomic<unsigned int> fCount;
|
||||
};
|
||||
|
||||
struct MonitorStatus
|
||||
{
|
||||
MonitorStatus()
|
||||
: fActive(true)
|
||||
{}
|
||||
|
||||
bool fActive;
|
||||
};
|
||||
|
||||
struct alignas(32) MetaHeader
|
||||
{
|
||||
uint64_t fSize;
|
||||
uint64_t fRegionId;
|
||||
boost::interprocess::managed_shared_memory::handle_t fHandle;
|
||||
};
|
||||
|
||||
struct RegionBlock
|
||||
{
|
||||
RegionBlock()
|
||||
: fHandle()
|
||||
, fSize(0)
|
||||
{}
|
||||
|
||||
RegionBlock(boost::interprocess::managed_shared_memory::handle_t handle, size_t size)
|
||||
: fHandle(handle)
|
||||
, fSize(size)
|
||||
{}
|
||||
|
||||
boost::interprocess::managed_shared_memory::handle_t fHandle;
|
||||
size_t fSize;
|
||||
};
|
||||
|
||||
} // namespace shmem
|
||||
} // namespace mq
|
||||
} // namespace fair
|
||||
|
||||
#endif /* FAIR_MQ_SHMEM_COMMON_H_ */
|
Reference in New Issue
Block a user