mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
shm: revert some changes from c85d6e0
that introduced a race
This commit is contained in:
parent
021c1b1c4d
commit
9bf908fb52
|
@ -327,7 +327,6 @@ class Manager
|
|||
|
||||
fShmRegions->emplace(id, RegionInfo(path.c_str(), flags, userFlags, fShmVoidAlloc));
|
||||
|
||||
r.first->second->InitializeQueues();
|
||||
r.first->second->StartReceivingAcks();
|
||||
result.first = &(r.first->second->fRegion);
|
||||
result.second = id;
|
||||
|
|
|
@ -309,8 +309,6 @@ class Message final : public fair::mq::Message
|
|||
}
|
||||
|
||||
if (fRegionPtr) {
|
||||
fRegionPtr->InitializeQueues();
|
||||
fRegionPtr->StartSendingAcks();
|
||||
fRegionPtr->ReleaseBlock({fMeta.fHandle, fMeta.fSize, fMeta.fHint});
|
||||
} else {
|
||||
LOG(warn) << "region ack queue for id " << fMeta.fRegionId << " no longer exist. Not sending ack";
|
||||
|
|
|
@ -104,6 +104,10 @@ struct Region
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
InitializeQueues();
|
||||
StartSendingAcks();
|
||||
|
||||
LOG(trace) << "shmem: initialized region: " << fName << " (" << (fRemote ? "remote" : "local") << ")";
|
||||
}
|
||||
|
||||
|
@ -116,7 +120,6 @@ struct Region
|
|||
{
|
||||
using namespace boost::interprocess;
|
||||
|
||||
if (fQueue == nullptr) {
|
||||
if (fRemote) {
|
||||
fQueue = std::make_unique<message_queue>(open_only, fQueueName.c_str());
|
||||
} else {
|
||||
|
@ -124,14 +127,11 @@ struct Region
|
|||
}
|
||||
LOG(trace) << "shmem: initialized region queue: " << fQueueName << " (" << (fRemote ? "remote" : "local") << ")";
|
||||
}
|
||||
}
|
||||
|
||||
void StartSendingAcks()
|
||||
{
|
||||
if (!fAcksSender.joinable()) {
|
||||
fAcksSender = std::thread(&Region::SendAcks, this);
|
||||
}
|
||||
}
|
||||
void SendAcks()
|
||||
{
|
||||
std::unique_ptr<RegionBlock[]> blocks = std::make_unique<RegionBlock[]>(fAckBunchSize);
|
||||
|
|
Loading…
Reference in New Issue
Block a user