FairMQRegion and examples/advanced/Region

This commit is contained in:
Alexey Rybalchenko
2017-06-02 13:50:13 +02:00
committed by Mohammad Al-Turany
parent 65f1b96dc3
commit 221d2567f0
32 changed files with 843 additions and 156 deletions

View File

@@ -0,0 +1,60 @@
/********************************************************************************
* 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;
};
} // namespace shmem
} // namespace mq
} // namespace fair
#endif /* FAIR_MQ_SHMEM_COMMON_H_ */