From 686d2cd2454c6f8c718731824613e43fd690bb0d Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 30 Jan 2013 19:47:54 +0000 Subject: QPID-4514: Remove IO readCredit throttling only used by removed cluster code git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1440616 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/AsynchIOHandler.cpp | 38 +----------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'cpp/src/qpid/sys/AsynchIOHandler.cpp') diff --git a/cpp/src/qpid/sys/AsynchIOHandler.cpp b/cpp/src/qpid/sys/AsynchIOHandler.cpp index 0225b11d27..13c71e301b 100644 --- a/cpp/src/qpid/sys/AsynchIOHandler.cpp +++ b/cpp/src/qpid/sys/AsynchIOHandler.cpp @@ -59,8 +59,7 @@ AsynchIOHandler::AsynchIOHandler(const std::string& id, ConnectionCodec::Factory reads(0), readError(false), isClient(isClient0), - nodict(nodict0), - readCredit(InfiniteCredit) + nodict(nodict0) {} AsynchIOHandler::~AsynchIOHandler() { @@ -104,21 +103,6 @@ void AsynchIOHandler::activateOutput() { aio->notifyPendingWrite(); } -// Input side -void AsynchIOHandler::giveReadCredit(int32_t credit) { - // Check whether we started in the don't about credit state - if (readCredit.boolCompareAndSwap(InfiniteCredit, credit)) - return; - // TODO In theory should be able to use an atomic operation before taking the lock - // but in practice there seems to be an unexplained race in that case - ScopedLock l(creditLock); - if (readCredit.fetchAndAdd(credit) != 0) - return; - assert(readCredit.get() >= 0); - if (readCredit.get() != 0) - aio->startReading(); -} - namespace { SecuritySettings getSecuritySettings(AsynchIO* aio, bool nodict) { @@ -133,26 +117,6 @@ void AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) { return; } - // Check here for read credit - if (readCredit.get() != InfiniteCredit) { - if (readCredit.get() == 0) { - // FIXME aconway 2009-10-01: Workaround to avoid "false wakeups". - // readbuff is sometimes called with no credit. - // This should be fixed somewhere else to avoid such calls. - aio->unread(buff); - return; - } - // TODO In theory should be able to use an atomic operation before taking the lock - // but in practice there seems to be an unexplained race in that case - ScopedLock l(creditLock); - if (--readCredit == 0) { - assert(readCredit.get() >= 0); - if (readCredit.get() == 0) { - aio->stopReading(); - } - } - } - ++reads; size_t decoded = 0; if (codec) { // Already initiated -- cgit v1.2.1