0

私たちのアプリケーションでは、複数のログ ファイルをさまざまな方法で (さまざまなライブラリを介して) 書き込みます。バッファをフラッシュするときに、ファイルの 1 つが時々ブロックされます。その時のスタックトレースは次のとおりです。

at Microsoft.Win32.Win32Native.WriteFile(SafeFileHandle handle, Byte* bytes, Int32 numBytesToWrite, Int32& numBytesWritten, IntPtr mustBeZero)
at Microsoft.Win32.Win32Native.WriteFile(SafeFileHandle handle, Byte* bytes, Int32 numBytesToWrite, Int32& numBytesWritten, IntPtr mustBeZero)
at System.IO.FileStream.WriteFileNative(SafeFileHandle handle, Byte[] bytes, Int32 offset, Int32 count, NativeOverlapped* overlapped, Int32& hr)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer)
at System.IO.FileStream.Flush(Boolean flushToDisk)
...

Process Explorer (Sysinternals Suites から) では、ブロッキング ファイルに常に多くの「参照」があることに気付きました。

参考文献

しかし、他のログ ファイル (常に問題ありません) にはそれぞれ 1 つの参照しかありません。

ファイルの「参照」とは何ですか? フラッシュ時にファイルがブロックされる理由はありますか?

4

0 に答える 0