c# - Locking property get/set -
is next code safe, multiple threads accessing property not writing particular object. new objects beingness created , assigned. multiple threads phone call createxmldoc
, readxmldoc
public class dataholder { public xmldocument xmldoc {get; set;} } public class accessclass { dataholder dataholderinstance; public accessclass(dataholder _dataholder) { dataholderinstance = _dataholder; } private void createxmldoc() { xmldocument _xmldoc = new xmldocument(); dataholderinstance.xmldoc = _xmldoc; } private void readxmldoc() { xmlnodelist elemlist = dataholderinstance.xmldoc.getelementsbytagname("title"); } }
from purely technical standpoint, code have provided above, not exhibit thread safety issues (i.e. info corruption etc).. question have inquire is, functional standpoint, "thread safe" behavior desired.
c# .net
No comments:
Post a Comment