diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-06-26 18:23:27 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-06-26 18:23:27 +0000 |
commit | 1ab07197127e990da2c765ea0ffa5fd8ca47b7b6 (patch) | |
tree | 18895db4a1059d984b92ab608d84c13d40df7401 /cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp | |
parent | cbd4f9c22974db5f53b42a4326486ec8325b79cc (diff) | |
download | qpid-python-1ab07197127e990da2c765ea0ffa5fd8ca47b7b6.tar.gz |
QPID-3858: WIP - fixed a few logic errors and race conditions in the consume and transactional code
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1354149 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp')
-rw-r--r-- | cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp b/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp index 3ac6867ce1..4a2bc2bf0c 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp @@ -53,17 +53,12 @@ MessageConsumer::~MessageConsumer() void MessageConsumer::record(boost::shared_ptr<DeliveryRecord> dr) { - // TODO: May need a lock? m_unacked.push_back(dr); } void -MessageConsumer::dequeueComplete() -{ -//std::cout << "MessageConsumer::dequeueComplete()" << std::endl << std::flush; - // TODO: May need a lock - //++m_numMsgs; -} +MessageConsumer::commitComplete() +{} void* MessageConsumer::runConsumers() @@ -75,8 +70,10 @@ MessageConsumer::runConsumers() tb = new qpid::broker::TxnBuffer(m_resultQueue); } + uint32_t msgsPerConsumer = m_perfTestParams.m_numEnqThreadsPerQueue * m_perfTestParams.m_numMsgs / + m_perfTestParams.m_numDeqThreadsPerQueue; uint32_t numMsgs = 0UL; - while (numMsgs < m_perfTestParams.m_numMsgs) { + while (numMsgs < msgsPerConsumer) { if (m_queue->dispatch(*this)) { ++numMsgs; if (useTxns) { @@ -101,7 +98,6 @@ MessageConsumer::runConsumers() (*i)->accept(); } m_unacked.clear(); - //++numMsgs; } } else { ::usleep(1000); // TODO - replace this poller with condition variable |