|
macta wrote:
> I am watching for edits to a file so that I can reparse it if you make a
> change - it seems simpler in my code to create a watcher for each file
> (and as its intended to be a web app in swazoo) with an associated
> Thread to broadcast the change to my object.
>
> However is this a bad idea? From what I recall Threads are cheap - not
> sure about ChangeReaders... I guess I am wondering if I really have to
> create a single ChangeReader and Thread and have objects register with
> it for updates?
Tim,
I'm afraid that I don't have a yes/no answer to your question, because I
have only used that Windows API with very few "ChangeReaders" (I have my
own implementation that I did in D5).
IF there is a performance problem, it might not be with the threads
(because they're not permanently created and discarded), but more likely
with the underlying Windows API that has to manage all those different
handles that are associated with the ChangeReaders.
The first question that comes to mind is, how many different
ChangeReaders are we actually talking about? 10s? 100s? 1000s?
If it is in the low double-digits, it's probably nothing to worry about.
Just my 2 cents,
Bernhard
|