Is it safe to use the same Encoding
object from different threads?
By "using" I mean, calling Encoding.GetString()
, Encoding.GetBytes()
and write some XML with an XmlWriter
(created by something like XmlWriter.Create(myStream, new XmlWriterSettings() { Encoding = myEncoding })
.
The msdn site states that "Any instance members are not guaranteed to be thread safe".
So, how can I safely write two XML documents concurrently? (thank you!!)