S
Steve
Hi,
I have a background thread which can periodically update a file. My actions
in the UI thread can also update this file (using xmldocument.save()). Is
there an easy way to makesure that when something has the file open nothing
else can and must wait its turn.
I've tried having a global object (object x = new object) and tried locking
this ( lock (x) {..file access stuff} ) but gets some deadlock problem.
I've also tried setting a global bool when I start file access stuff and
tried waiting until it gets reset but my background thread doesn't appear to
set it right.
Are there any simple tutorials out there for this kind of thing as my
initial look at threads are confusing and I'm sure I'm going at this in the
wrong way.
thanks in advance. I understand this may not be the right place for this
question but I believe the .CF is limited on its thread functionality -
hence why I'm here.
Steve
I have a background thread which can periodically update a file. My actions
in the UI thread can also update this file (using xmldocument.save()). Is
there an easy way to makesure that when something has the file open nothing
else can and must wait its turn.
I've tried having a global object (object x = new object) and tried locking
this ( lock (x) {..file access stuff} ) but gets some deadlock problem.
I've also tried setting a global bool when I start file access stuff and
tried waiting until it gets reset but my background thread doesn't appear to
set it right.
Are there any simple tutorials out there for this kind of thing as my
initial look at threads are confusing and I'm sure I'm going at this in the
wrong way.
thanks in advance. I understand this may not be the right place for this
question but I believe the .CF is limited on its thread functionality -
hence why I'm here.
Steve