473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

threading using filewatcher object

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
1 2126

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ron King Jr | last post by:
I have a small problem with my windows service. The first time I start the service everything works the way it's suppose to, but randomly the service fails. The jist of the service is to use the...
8
by: Yatharth | last post by:
Hi, I m new to threading and i have successfully runed threading but i could display value on my web page ,but its working in code behind when i see it through debugger,plzzzzzzz help me here...
2
by: Roger Twomey | last post by:
I am working on a filewatcher application. The premis is: User uploads an xml file onto the web server the filewatcher app sees the xml file filewatcher app reads the file and inserts...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
3
by: ba.hons | last post by:
Hello All. I have a filewatcher object which looks at a shared folder and when a new XML file is placed in this folder the on create method calls a method which reads the XML file and based on...
7
by: Mike P | last post by:
I am trying to write my first program using threading..basically I am moving messages from an Outlook inbox and want to show the user where the process is up to without having to wait until it has...
9
by: cgwalters | last post by:
Hi, I've recently been working on an application which does quite a bit of searching through large data structures and string matching, and I was thinking that it would help to put some of this...
7
by: tshad | last post by:
What exactly is FileWatcher doing? When you drop 100 files in a folder it is watching, it normally will fire of the event 100 times. In my case, I do all my processing on the first event so I...
3
by: Aussie Rules | last post by:
Hi I create a number of filewatchers in my code. I have a need to delete some of the file watchers, but can not figure out how to do this without stopping the application and restarting. To...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.