By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,212 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,212 IT Pros & Developers. It's quick & easy.

threading using filewatcher object

P: n/a
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

Jan 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On 25 Jan 2007 13:47:01 -0800, "ba.hons" <ba*****@gmail.comwrote:
>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
Jan 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.