468,512 Members | 1,500 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

xml multithreading multiprocess

Did anybody knows a way to secure the read/write multithreading and
multiprocess in an xml file ?

Thank you
Nov 11 '05 #1
3 2416
You can't rely on using an object to manage concurrency for you. The
System.Xml.XmlDocument class is not thread-safe, and neither is XmlReader or
XmlWriter (or their derivatives).

You have to implement concurrency yourself. You would need a wrapper object
over the XmlDocument, XmlReader, or XmlWriter class.

If you are using XmlReader or XmlWriter, you would likely need to implement
a ReaderWriterLock [1] for concurrency control. Obviously, you would only
need to acquire a reader lock for methods within the XmlReader, and a
writer lock for methods within the XmlWriter.

If you are using XmlDocument, you have to look at the method you are working
with to determine what type of lock to acquire. If the method simply reads
a property from the document, then acquire a reader lock. If the method
updates the document, acqire a writer lock.

[1]
http://msdn.microsoft.com/library/de...classtopic.asp
--
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans
"Alina" <al*******@alinacons.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Did anybody knows a way to secure the read/write multithreading and
multiprocess in an xml file ?

Thank you

Nov 11 '05 #2
BTW - There are going to be limitations to attempting to do this, my post
GREATLY assumes you have some experience with threading. If you don't have
experience with threading, use a database.

--
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans

"Alina" <al*******@alinacons.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Did anybody knows a way to secure the read/write multithreading and
multiprocess in an xml file ?

Thank you

Nov 11 '05 #3
Thank you.

"Kirk Allen Evans" <ka*****@nospamxmlandasp.net> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...
BTW - There are going to be limitations to attempting to do this, my post
GREATLY assumes you have some experience with threading. If you don't have experience with threading, use a database.

--
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans

"Alina" <al*******@alinacons.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
Did anybody knows a way to secure the read/write multithreading and
multiprocess in an xml file ?

Thank you


Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

47 posts views Thread by mihai | last post: by
16 posts views Thread by Robert Zurer | last post: by
5 posts views Thread by sarge | last post: by
9 posts views Thread by tommy | last post: by
2 posts views Thread by Rich | last post: by
55 posts views Thread by Sam | last post: by
5 posts views Thread by sandy82 | last post: by
2 posts views Thread by Pradnya Patil | last post: by
7 posts views Thread by Ray | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.