Is MSDN referencing a system.thread, a worker thread, an io thread or all three?

Posted by w0051977 on Stack Overflow See other posts from Stack Overflow or by w0051977
Published on 2013-10-26T15:13:27Z Indexed on 2013/10/26 15:54 UTC
Read the original article Hit count: 149

Filed under:
|

Please see the warning below taken from the StreamWriter class specification (http://msdn.microsoft.com/en-us/library/system.io.streamwriter.aspx):

"Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe."

I understand that a W3WC process contains two thread pools i.e. worker threads and I/O threads. A worker thread could contain many threads of its own (if the application creates its own System.Thread instances).

Does the warning only relate to System.Threads or does it relate to worker threads and I/O threads as well I.e. as the instance variables of the streamwriter class are not thread safe then does this mean that there would be problems if multiple worker threads access it eg if two users on two different web clients attempt to write to the log file at the same time, then could one lock out the other?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net