threading using filewatcher object

  • Thread starter Thread starter ba.hons
  • Start date Start date
B

ba.hons

Hello,

I have a file watcher object which i use to check a directory for XML
files.

When an XML file is placed in the directory i check the filename, to
make sure it for me, then parse the XML and depending on whats in it,
write an XML file back to the same directory.

Now i have this all working, but i thought the best thing i could do is
create a new thread each time the create event is fired in my file
watcher object, BUT am awful with threads, any ideas on what would be
the best approach for this?

Am i right in thinking that i would need to create a method in my class
which matches the threading delegate, e.g

public void mymethod()
{

}

and then do everything within this method?

any help would be great

thanks in advance

ADAM
 
FileWatcher is inherintly multithreaded so you don't need to do
anything. Whenever FileWatcher detects a change, it triggers your
callback on a threadpool thread.

HTH,

Sam
 
Back
Top