Index: src/libchcore/TEventCounter.h =================================================================== diff -u -rb051cbac8dac8c448507aa7c64753af9cf793af5 -rc175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3 --- src/libchcore/TEventCounter.h (.../TEventCounter.h) (revision b051cbac8dac8c448507aa7c64753af9cf793af5) +++ src/libchcore/TEventCounter.h (.../TEventCounter.h) (revision c175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3) @@ -35,7 +35,8 @@ public: TEventCounter(T initialValue = 0) : m_event(true, false), - m_tCounter(initialValue) + m_tCounter(initialValue), + m_tMaxUsed(initialValue) { UpdateEvent(); } @@ -46,6 +47,8 @@ void Increase() { ++m_tCounter; + if(m_tCounter > m_tMaxUsed) + m_tMaxUsed = m_tCounter; UpdateEvent(); } @@ -60,6 +63,11 @@ return m_tCounter; } + T GetMaxUsed() const + { + return m_tMaxUsed; + } + HANDLE GetEventHandle() const { return m_event.Handle(); @@ -75,6 +83,7 @@ private: TEvent m_event; T m_tCounter; + T m_tMaxUsed; }; } Index: src/libchcore/TOverlappedReaderFB.cpp =================================================================== diff -u -rc719644bb4360fcf7ccf6f1139bcae852bd6effd -rc175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3 --- src/libchcore/TOverlappedReaderFB.cpp (.../TOverlappedReaderFB.cpp) (revision c719644bb4360fcf7ccf6f1139bcae852bd6effd) +++ src/libchcore/TOverlappedReaderFB.cpp (.../TOverlappedReaderFB.cpp) (revision c175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3) @@ -44,7 +44,8 @@ m_spSrcFileInfo(spSrcFileInfo), m_spSrcFile(), m_spStats(spStats), - m_rThreadController(rThreadController) + m_rThreadController(rThreadController), + m_spLog(logger::MakeLogger(spLogFileData, L"File-Reader")) { if(!spFeedbackHandler) throw TCoreException(eErr_InvalidArgument, L"spFeedbackHandler is NULL", LOCATION); @@ -146,6 +147,8 @@ WaitForOnTheFlyBuffers(); ClearQueues(); + LOG_DEBUG(m_spLog) << L"Reader stopping processing. Max on-the-fly requests: " << m_counterOnTheFly.GetMaxUsed(); + if(m_eThreadResult == TSubTaskBase::eSubResult_Continue && bDataSourceFinished) m_eventReadingFinished.SetEvent(); } Index: src/libchcore/TOverlappedReaderFB.h =================================================================== diff -u -rc719644bb4360fcf7ccf6f1139bcae852bd6effd -rc175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3 --- src/libchcore/TOverlappedReaderFB.h (.../TOverlappedReaderFB.h) (revision c719644bb4360fcf7ccf6f1139bcae852bd6effd) +++ src/libchcore/TOverlappedReaderFB.h (.../TOverlappedReaderFB.h) (revision c175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3) @@ -83,6 +83,8 @@ TWorkerThreadController& m_rThreadController; TSubTaskBase::ESubOperationResult m_eThreadResult = TSubTaskBase::eSubResult_Continue; + + logger::TLoggerPtr m_spLog; }; using TOverlappedReaderFBPtr = std::shared_ptr; Index: src/libchcore/TOverlappedWriterFB.cpp =================================================================== diff -u -rc719644bb4360fcf7ccf6f1139bcae852bd6effd -rc175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3 --- src/libchcore/TOverlappedWriterFB.cpp (.../TOverlappedWriterFB.cpp) (revision c719644bb4360fcf7ccf6f1139bcae852bd6effd) +++ src/libchcore/TOverlappedWriterFB.cpp (.../TOverlappedWriterFB.cpp) (revision c175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3) @@ -48,7 +48,8 @@ m_eventProcessingFinished(true, false), m_eventWritingFinished(true, false), m_counterOnTheFly(), - m_rThreadController(rThreadController) + m_rThreadController(rThreadController), + m_spLog(logger::MakeLogger(spLogFileData, L"File-Writer")) { if(!spFilesystem) throw TCoreException(eErr_InvalidArgument, L"spFilesystem is NULL", LOCATION); @@ -77,12 +78,6 @@ if(!pBuffer) throw TCoreException(eErr_InternalProblem, L"Write was possible, but no buffer is available", LOCATION); - if(m_bReleaseMode) - { - m_spWriter->AddEmptyBuffer(pBuffer); - return TSubTaskBase::eSubResult_Continue; - } - m_counterOnTheFly.Increase(); pBuffer->SetParam(this); @@ -99,12 +94,6 @@ if(!pBuffer) throw TCoreException(eErr_InternalProblem, L"Failed to retrieve write failed buffer", LOCATION); - if(m_bReleaseMode) - { - m_spWriter->AddEmptyBuffer(pBuffer); - return TSubTaskBase::eSubResult_Continue; - } - TSubTaskBase::ESubOperationResult eResult = m_spDstFile->HandleWriteError(*pBuffer); if(eResult == TSubTaskBase::eSubResult_Retry) { @@ -126,15 +115,6 @@ file_size_t fsWritten = pBuffer->GetRealDataSize(); - if(m_bReleaseMode) - { - AdjustProcessedSize(fsWritten); - - m_spWriter->AddEmptyBuffer(pBuffer); - - return TSubTaskBase::eSubResult_Continue; - } - TSubTaskBase::ESubOperationResult eResult = TSubTaskBase::eSubResult_Continue; if(pBuffer->IsLastPart()) { @@ -366,6 +346,8 @@ WaitForOnTheFlyBuffers(); ClearBuffers(); + + LOG_DEBUG(m_spLog) << L"Writer stopping processing. Max on-the-fly requests: " << m_counterOnTheFly.GetMaxUsed(); if(m_eThreadResult == TSubTaskBase::eSubResult_Continue && bWrittenLastBuffer) m_eventWritingFinished.SetEvent(); Index: src/libchcore/TOverlappedWriterFB.h =================================================================== diff -u -rc719644bb4360fcf7ccf6f1139bcae852bd6effd -rc175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3 --- src/libchcore/TOverlappedWriterFB.h (.../TOverlappedWriterFB.h) (revision c719644bb4360fcf7ccf6f1139bcae852bd6effd) +++ src/libchcore/TOverlappedWriterFB.h (.../TOverlappedWriterFB.h) (revision c175b6c9d5be6ee6ee0eae90abb167b9eaf2abc3) @@ -75,7 +75,6 @@ TSubTaskStatsInfoPtr m_spStats; TFileInfoPtr m_spSrcFileInfo; TOverlappedProcessorRangePtr m_spDataRange; - bool m_bReleaseMode = false; bool m_bOnlyCreate = false; TEvent m_eventProcessingFinished; @@ -85,6 +84,8 @@ TWorkerThreadController& m_rThreadController; TSubTaskBase::ESubOperationResult m_eThreadResult = TSubTaskBase::eSubResult_Continue; + + logger::TLoggerPtr m_spLog; }; using TOverlappedWriterFBPtr = std::shared_ptr;