Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / November 2005

Tip: Looking for answers? Try searching our database.

XmlDocument.WriteTo thread safety

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charles.Deisler@gmail.com - 07 Nov 2005 02:44 GMT
I'm reading a xmldocument in from the file system and using
xmldocument.writeto(xmltextwriter) to stream the xml data to the
response.outputstream.  From what i've read, reading an xmldocument is
thread safe but does the writeto() method require a lock?

Thanks in advance!
Oleg Tkachenko [MVP] - 07 Nov 2005 10:10 GMT
> I'm reading a xmldocument in from the file system and using
> xmldocument.writeto(xmltextwriter) to stream the xml data to the
> response.outputstream.  From what i've read, reading an xmldocument is
> thread safe but does the writeto() method require a lock?

Well, with regard to XmlDocument itself, WriteTo() method is a read
operation - it walks through the whole tree and calls each node to write
itself to XmlWriter. So it's thread safe. Of course if you don't want
another thread to modify XmlDOcument while WriteTo() method works you
need some sort of synchronization.
Signature

Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com

Charles.Deisler@gmail.com - 09 Nov 2005 15:07 GMT

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.