In fact the client using my class needs to write information in a file.
However, it has really little time at disposal (I can not flush information
synchrously, it will take too much time). Therefore, the method called by
the client will make a writeline (which does not flush and therefore it is
quick) it will send set an event for an async. thread telling some info
needs to be flush.
Hope this sounds clear?
Do you have an answer to my question?
José
"Peter Q" <pm****@cogeco.ca> a écrit dans le message de
news:Hr*******************@read1.cgocable.net...
While one sw is writing to the file, the other one is flushing the buffer?
What are you trying to achieve here?
regards,
Peter
"Jos?Joye" <jose.joye@__No_SPam__bluewin__maPS_oN__.ch> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... I have 2 threads using the same StreamWriter (obtained from
FileInfo.AppendText).
This first thread will always use the WriteLine() method and the second
thread will always use the Flush() method.
At the present, I have protected the access to the StreamWriter using a
Lock() section.
Is this really particular case, is this necessary?
What could be the implication if I remove the Lock() section?
Thanks,
Jos?