M
Mark
Hi...
I've got an app that's pretty multi-threaded. While I'm debugging, I'm
trying to write a log file of events that happen, so I've got a global logger
that has
g_LogFileWriter = new StreamWriter(new FileStream(file, Append, Write.
Share.Read);
void Log2File(string format, params object[] arg)
{
lock (g_LogFileWriter)
{
g_LogFileWriter.WriteLine(format, arg);
g_LogFileWriter.Flush();
}
}
Problem is that when things happen very close together and multiple threads
call this, lines seem to be getting lost. Is there some timing limit on how
tight many threads can write to the same file stream?
Thanks
Mark
I've got an app that's pretty multi-threaded. While I'm debugging, I'm
trying to write a log file of events that happen, so I've got a global logger
that has
g_LogFileWriter = new StreamWriter(new FileStream(file, Append, Write.
Share.Read);
void Log2File(string format, params object[] arg)
{
lock (g_LogFileWriter)
{
g_LogFileWriter.WriteLine(format, arg);
g_LogFileWriter.Flush();
}
}
Problem is that when things happen very close together and multiple threads
call this, lines seem to be getting lost. Is there some timing limit on how
tight many threads can write to the same file stream?
Thanks
Mark